MD
PDFtoMarkdown
JavaScript & WebAssembly

JavaScript & TypeScript In-Browser WASM Engine

Embed client-side PDF to Markdown conversion in your web apps. High-performance WebAssembly with Web Worker sandboxing and real-time streaming.

100% In-Browser Private
5 min read
Updated September 2026

Live JavaScript Web Worker Sandbox

100% In-Browser Conversion — Your Files Are Never Uploaded

Drag & Drop your PDF document here

or browse files on your device

⚡ No file size limit 🔒 100% Private
Markdown Output
JavaScript WebAssembly Spatial AST Engine Architecture Diagram

NPM Installation

npm install @pdftomarkdown/wasm TypeScript Included

TypeScript / Web Worker Implementation

converter.ts Browser / Web Worker
import { initPdfConverter } from '@pdftomarkdown/wasm';

// Initialize non-blocking WASM worker
const converter = await initPdfConverter({
  workerUrl: '/workers/pdfConverter.worker.js',
  onProgress: (page, total) => {
    console.log(`Processing page ${page} of ${total}...`);
  }
});

// Convert File / ArrayBuffer from drag-and-drop input
async function handleFileUpload(file: File): Promise<string> {
  const arrayBuffer = await file.arrayBuffer();
  
  const markdown = await converter.convert(arrayBuffer, {
    extractTables: true,
    mathDelimiters: 'dollar',
    mode: 'gfm'
  });

  return markdown;
}

Frequently Asked Questions

Everything you need to know about format extraction, privacy, and markdown compatibility.

Can I run this WebAssembly converter inside modern frontend frameworks like React, Next.js, and Vue?

Yes. The `@pdftomarkdown/wasm` package works seamlessly with React, Next.js, Vue, Nuxt, Svelte, and vanilla JavaScript. It runs inside a dedicated Web Worker so the main UI thread never drops frames during conversion.

Does it require Node.js or server-side rendering?

No. The WASM module compiles directly to client-side WebAssembly and executes locally inside any evergreen browser (Chrome, Firefox, Safari, Edge) without making a single backend API call.

How does it handle memory management for large PDF files?

The library utilizes transferable `ArrayBuffer` instances between the UI thread and Web Worker. Memory is allocated within a linear WASM page buffer and freed immediately upon page emission, keeping heap usage under 35 MB even for 200+ page documents.

Is streaming progress supported?

Yes. The worker posts `{ type: 'PROGRESS', page: current, totalPages: total }` events as each page completes, enabling rich real-time progress bars and streaming UI previews.

Related Conversion Guides & Workflows

Explore dedicated documentation for other document formats and developer pipelines.