🚀 Md2Docx — Pluggable Engine with Rich Official Plugin Ecosystem

Markdown to Word Native, Modular, Extensible

Convert Markdown into native, editable Word (.docx) documents in browsers or Node.js. Modular by design — cherry-pick official plugins, or easily author your own.

Zero-Config CLI
$npx @m2d/cli report.md -o report.docx
Interactive Playground & Engine Showcase

Pluggable Architecture & Official Plugin Ecosystem

Select your compilation target, toggle our rich suite of official plugins, or wire custom AST transformers to export native Microsoft Word (.docx) documents in real-time.

Official Plugin Suite (Pluggable Pipeline):
9 of 9 Active
|
Syntax Highlighting Engine:
Frontmatter Layout Synthesizer:
Preset:
321 words|~2 pages
7 headings1 table5 formulas1 diagram
Click compile below to execute with selected target & plugins
Engineered for Modern Workflows

Why Developers & Enterprises Choose Md2Docx

A purpose-built document compiler that balances lightweight frontend privacy with robust server-side automation.

Client & Server

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.

Clean OpenXML

Native OpenXML Fidelity

Translates Markdown AST nodes into genuine Microsoft Word structures — native MathML equations, editable tables, vector graphics, and true outline numbering.

Pluggable & Extensible

Pluggable Core & Rich Official Plugins

Engineered on the Unified & Remark AST ecosystem. Leverage our comprehensive suite of official plugins or write custom plugins.

Layout Synthesis

Executive Cover Pages & Callouts

Turn YAML/TOML frontmatter into professional title pages, divider rules, author metadata lines, page breaks, and callout banners with zero manual markup.

CLI Automation

Zero-Config Terminal CLI

Run instant document compilation via npx @m2d/cli or in CI/CD release pipelines with structured logging, configuration files, and multiple binary aliases.

AI Ready

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.

Feature Comparison

How Md2Docx Compares

See how Md2Docx stacks up against traditional CLI binaries, imperative libraries, and HTML wrappers.

Feature / CapabilityMd2DocxPandocdocx.js alonehtml-docx-js
Runs 100% in BrowserYes (0ms network, full privacy)No (native binary required)Yes (client-side only)Yes (limited DOM)
Markdown / MDAST FirstNative AST parsing & transformsYes (internal AST)Manual imperative code onlyHTML parsing only
Zero Binary DependenciesPure TypeScript / JavaScriptRequires Haskell/C++ binaryPure JavaScriptPure JavaScript
LaTeX Equations to OMMLNative Word Math elementsRequires LaTeX engineManual MathRuns requiredNot supported
Mermaid to Embedded VectorAutomatic SVG + self-healingRequires external filter / CLIManual image buffersNot supported
Extensible Plugin PipelineStandard Unified / Remark pluginsLua filtersImperative function wrappersNone
Serverless & Edge ReadyLightweight (~35-40kB core)Heavy container footprintLightweightLimited support
20 Purpose-Built Packages

The Md2Docx Modular Ecosystem

Organized into clear architectural layers — start with high-level batteries-included entry points, or cherry-pick lightweight scoped plugins for microservices and edge runtimes.

Quickstart Entry
Universal

@m2d/md2docx

All-in-one batteries-included Markdown to DOCX converter with zero configuration.

Explore Documentation
Quickstart Entry
Node.js

@m2d/cli

Zero-config terminal CLI and headless batch document generation engine.

Explore Documentation
Quickstart Entry
Universal

mdast2docx

Complete all-in-one distribution bundle pre-wired with all official plugins.

Explore Documentation
Framework Extension
Browser

@m2d/tiptap

Client-side DOCX export extension for Tiptap 3 / ProseMirror with frontmatter preservation.

Explore Documentation
Framework Extension
Universal

@m2d/react-markdown

SSR-friendly React Markdown renderer that captures AST for instant Word export.

Explore Documentation
Unified Compiler
Browser

@m2d/remark-docx

Official Unified/Remark compiler plugin for direct in-browser DOCX generation.

Explore Documentation
Unified Compiler
Node.js

@m2d/remark-docx-node

Server-side Remark compiler plugin with native Sharp and beautiful-mermaid rasterization.

Explore Documentation
Content Plugin
Universal

@m2d/frontmatter

Parses YAML/TOML front-matter metadata into docxProps, cover pages, and info-boxes.

Explore Documentation
Content Plugin
Universal

@m2d/table

Rich GFM tables with custom borders, cell padding, repeating headers, and background shading.

Explore Documentation
Content Plugin
Universal

@m2d/math

LaTeX math equations translated directly into native editable Word OMML MathML.

Explore Documentation
Content Plugin
Browser

@m2d/mermaid

Browser Mermaid diagrams with SVG extraction and self-healing syntax error repair.

Explore Documentation
Content Plugin
Node.js

@m2d/mermaid-node

Headless server-side Mermaid renderer powered by beautiful-mermaid with zero browser dependencies.

Explore Documentation
Content Plugin
Browser

@m2d/html

Converts HTML tags, inline CSS styles, and <style> block stylesheets into styled OpenXML nodes.

Explore Documentation
Content Plugin
Node.js

@m2d/html-node

Lightweight server-side HTML parser powered by LinkeDOM without heavy JSDOM overhead.

Explore Documentation
Content Plugin
Browser

@m2d/image

Browser image rasterization with IndexedDB caching and collapsible code block fallbacks.

Explore Documentation
Content Plugin
Node.js

@m2d/image-node

Server-side image rasterizer powered by Sharp with authentic Word code block fallbacks.

Explore Documentation
Content Plugin
Universal

@m2d/list

Hierarchical decimal numbering (1.1.1) and custom nested bullet glyphs.

Explore Documentation
Core Engine
Universal

@m2d/core

Foundational AST-to-OpenXML compiler, plugin pipeline, and warnings deduplication.

Explore Documentation
Core Engine
Universal

@m2d/cache

Persistent xxhash-wasm and IndexedDB caching engine for rasterized diagrams and assets.

Explore Documentation
Core Engine
Universal

@m2d/mdast

TypeScript types and schemas for extended MDAST OpenXML nodes and properties.

Explore Documentation