Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Running Pandoc in the Browser: WebAssembly, Web Workers, and a 58 MB Module

Description and use

A fully client-side Word→Markdown converter built on Pandoc compiled to WebAssembly, running in a Web Worker with lazy loading, compiled-module caching via IndexedDB, and a WASI virtual filesystem for file I/O. The tool is available at wordtomarkdown.com with no account and no uploads.

Problem

Users need a document conversion tool (e.g., .docx to Markdown) that never uploads files to a server, preserving sensitive documents like contracts, manuscripts, or medical records.

Outcome

A fully client-side Word→Markdown converter built on Pandoc compiled to WebAssembly, running in a Web Worker with lazy loading, compiled-module caching via IndexedDB, and a WASI virtual filesystem for file I/O. The tool is available at wordtomarkdown.com with no account and no uploads.

Workflow

  • User drops a file into the browser tab (lazy load of the WASM module on intent).
  • Module is loaded into a Web Worker so the UI stays responsive.
  • File is written into the WASI virtual filesystem at an input path.
  • Pandoc runs against that path with the correct reader and writer flags.
  • Resulting bytes are read back out of the virtual filesystem.
  • Result is rendered in the UI.

Evidence

Every 'convert my document' tool I've tried has the same shape: you pick a file, it uploads somewhere, a server does the work, you get a download link back. That's fine for public data. It's a much worse deal when the file is a contract, a manuscript, a medical record, or anything else you'd rather not hand to a stranger's S3 bucket.

Source

So I built a Word→Markdown converter that never uploads anything. It runs the real Pandoc engine, compiled to WebAssembly, inside a browser tab.

Source

Pandoc takes a different route. It parses each format into a typed abstract syntax tree, then writes that AST back out in whatever target format you ask for. Nothing gets flattened prematurely.

Source

One engine covers the whole matrix. The same binary reads docx, odt, epub, html, latex, rst, org, csv, tsv, mediawiki, docbook, opml, ipynb and Markdown, and writes Markdown, HTML, reStructuredText and LaTeX

Source

Pandoc is a Haskell program. The official WASM build exists, and it works, and it is large — around 58 MB once you include the engine and the data files it needs.

Source

Load it lazily, on intent. The module starts downloading when the user actually drops a file or hits convert — not when the page renders. The landing page stays instant; the cost is paid by people who are already committed.

Source

  • Record date: 2026-10-20T12:41:16.601Z