🚀 Md2Docx — Universal Markdown to Word Engine

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.

Interactive Playground

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.

Active Ecosystem Plugins Loaded in Pipeline:
@m2d/math
LaTeX Equations
@m2d/mermaid
Mermaid Diagrams
@m2d/image
Browser Images & SVGs
@m2d/image-node
Node Sharp Rasterizer
@m2d/table
GFM Tables
@m2d/list
Nested Lists
@m2d/html
HTML Tags
Client-Side (Browser)0ms Network

6 client plugins active: Mermaid diagrams to SVG, LaTeX to MathRuns, GFM tables, and browser image rasterization.

Server-Side (Node API)HTTP Streaming

Rendered on demand via /api/docx with @m2d/image-node (Sharp) and server-timing diagnostics. Ideal for CLI exports, webhooks, and automated batch runs.

Presets:
Choose an environment to compile and download
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.

Composable

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.

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
Monorepo Architecture

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.

Explore Package

@m2d/html

Extend MDAST by parsing embedded HTML in Markdown. Converts HTML into structured MDAST nodes compatible with @m2d/core for DOCX generation.

Explore Package

@m2d/image

MDAST to DOCX plugin for resolving and embedding images. Supports base64, URLs, and custom resolvers for seamless DOCX image integration.

Explore Package

@m2d/image-node

Server-side Node.js image and SVG rasterization plugin for @m2d/core using sharp.

Explore Package

@m2d/list

Plugin to convert ordered and unordered lists from Markdown (MDAST) to DOCX. Supports nesting, custom bullets, and numbering styles.

Explore Package

@m2d/math

Plugin to convert mathematical expressions in Markdown (MDAST) to DOCX using LaTeX-style syntax. Integrates seamlessly with mdast2docx.

Explore Package

@m2d/mdast

Extended MDAST types and custom node data for mdast2docx with support for DOCX formatting.

Explore Package

@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.

Explore Package

@m2d/mermaid-node

Server-side Node.js Mermaid diagram plugin for @m2d/core using beautiful-mermaid.

Explore Package

@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.

Explore Package

@m2d/remark-docx

A unified plugin to prepare MDAST trees for DOCX conversion using mdast2docx.

Explore Package

@m2d/table

Plugin to convert Markdown tables (MDAST) to DOCX with support for rich formatting and seamless integration into mdast2docx.

Explore Package

mdast2docx

Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.

Explore Package