Markdown to Word
Native, Modular, Effortless
Convert standard Markdown, GFM tables, LaTeX formulas, and Mermaid diagrams into native, editable Microsoft Word (.docx) documents — with 100% in-browser client privacy or robust Node.js backend streaming.
Universal Client & Server DOCX Generation
Test the complete plugin ecosystem rendered 100% locally in your browser or streamed on demand from a Node.js server API.
6 client plugins active: Mermaid diagrams to SVG, LaTeX to MathRuns, GFM tables, and browser image rasterization.
Rendered on demand via /api/docx with @m2d/image-node (Sharp) and server-timing diagnostics. Ideal for CLI exports, webhooks, and automated batch runs.
Why Developers & Enterprises Choose Md2Docx
A purpose-built document compiler that balances lightweight frontend privacy with robust server-side automation.
Universal Dual Execution
Compile 100% in the browser with WebAssembly & JS for zero latency and complete data privacy, or stream headlessly in Node.js backends and serverless workers.
Native OpenXML Fidelity
Translates Markdown AST nodes into genuine Microsoft Word structures — native MathML equations, editable tables, vector graphics, and true outline numbering.
Modular Plugin Architecture
Built on the Unified & Remark ecosystem. Cherry-pick isolated plugins for LaTeX math, Mermaid diagrams, GFM tables, and images to keep bundles ultra-lean.
Generative AI Document Bridge
Transform raw Markdown output from ChatGPT, Claude, and Gemini into corporate-ready Word deliverables with robust self-healing and error resiliency.
How Md2Docx Compares
See how Md2Docx stacks up against traditional CLI binaries, imperative libraries, and HTML wrappers.
| Feature / Capability | Md2Docx | Pandoc | docx.js alone | html-docx-js |
|---|---|---|---|---|
| Runs 100% in Browser | Yes (0ms network, full privacy) | No (native binary required) | Yes (client-side only) | Yes (limited DOM) |
| Markdown / MDAST First | Native AST parsing & transforms | Yes (internal AST) | Manual imperative code only | HTML parsing only |
| Zero Binary Dependencies | Pure TypeScript / JavaScript | Requires Haskell/C++ binary | Pure JavaScript | Pure JavaScript |
| LaTeX Equations to OMML | Native Word Math elements | Requires LaTeX engine | Manual MathRuns required | Not supported |
| Mermaid to Embedded Vector | Automatic SVG + self-healing | Requires external filter / CLI | Manual image buffers | Not supported |
| Extensible Plugin Pipeline | Standard Unified / Remark plugins | Lua filters | Imperative function wrappers | None |
| Serverless & Edge Ready | Lightweight (~35-40kB core) | Heavy container footprint | Lightweight | Limited support |
The Md2Docx Modular Ecosystem
Choose the all-in-one umbrella distribution or cherry-pick lightweight scoped packages for microservices and edge runtimes.
@m2d/core
Core engine to convert extended MDAST to DOCX. Supports plugins for footnotes, images, lists, tables, and more. Designed for seamless Markdown-to-DOCX conversion.
@m2d/html
Extend MDAST by parsing embedded HTML in Markdown. Converts HTML into structured MDAST nodes compatible with @m2d/core for DOCX generation.
@m2d/image
MDAST to DOCX plugin for resolving and embedding images. Supports base64, URLs, and custom resolvers for seamless DOCX image integration.
@m2d/image-node
Server-side Node.js image and SVG rasterization plugin for @m2d/core using sharp.
@m2d/list
Plugin to convert ordered and unordered lists from Markdown (MDAST) to DOCX. Supports nesting, custom bullets, and numbering styles.
@m2d/math
Plugin to convert mathematical expressions in Markdown (MDAST) to DOCX using LaTeX-style syntax. Integrates seamlessly with mdast2docx.
@m2d/mdast
Extended MDAST types and custom node data for mdast2docx with support for DOCX formatting.
@m2d/mermaid
Enhance Markdown-to-DOCX conversion with Mermaid and mindmap diagram support using this plugin for @m2d/core. Converts code blocks into SVG images with customizable Mermaid config.
@m2d/mermaid-node
Server-side Node.js Mermaid diagram plugin for @m2d/core using beautiful-mermaid.
@m2d/react-markdown
A modern, SSR-friendly React Markdown renderer that preserves the MDAST tree for reuse (e.g., mdast2docx), supports full JSX children, unified plugins, and component overrides.
@m2d/remark-docx
A unified plugin to prepare MDAST trees for DOCX conversion using mdast2docx.
@m2d/table
Plugin to convert Markdown tables (MDAST) to DOCX with support for rich formatting and seamless integration into mdast2docx.
mdast2docx
Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.