Skip to content
← Utility Tools

DOCX to Markdown

Convert .docx to clean Markdown in your browser — nothing uploaded

DOCX to Markdown Converter (mammoth.js)

Migrating content from Word to a static-site generator, a wiki, or a docs platform is a recurring task and a chronically annoying one. Word's native XML format (the .docx zip with embedded XML parts) carries a lot of structure that Markdown does not need and a lot of styling that Markdown explicitly drops. The right conversion is structure-preserving and styling-shedding: keep the headings, lists, links, and tables; drop the font, color, and per-paragraph spacing overrides. mammoth.js is the well-tested library for exactly this transform, and this tool runs it in your browser so the document never leaves the tab.

What mammoth.js Preserves

Headings (Heading 1 through Heading 6 styles in Word map to # through ###### in Markdown), paragraphs, ordered and unordered lists (with nesting), hyperlinks, inline bold and italic, and the Word Quote and Intense Quote styles (as blockquotes). Monospaced or code-styled text is not detected automatically; map its style to code in the style-map box. Tables become GitHub-flavored Markdown tables, with the first row as the header. Images are embedded inline as data URIs, or left out with Skip images.

What mammoth.js Drops

Direct character formatting beyond bold/italic/code (font family, font size, color, highlight) — these have no Markdown equivalent and are intentionally dropped. Page-level constructs (headers, footers, page numbers, page breaks, multi-column layouts) — same reason. Tracked changes and comments — the rendered output is the accepted, comment-free version; the tracked-changes history is not part of the Markdown output. Equations made with the Word equation editor are not converted; for documents with serious mathematical content, a dedicated Word-to-LaTeX or Word-to-MathML tool is a better fit.

Why a Custom Style Map Is Sometimes Worth It

mammoth.js uses a style-map system that lets you specify how named Word styles convert to Markdown. The default map covers all the standard Heading and List styles. For documents that use custom styles (a corporate template often has a "Callout" style or a "Code Block" style that the default map doesn't recognize), you can provide a custom map at conversion time. Open Custom style map (advanced) and enter one rule per line in mammoth.js syntax, for example p[style-name='Callout'] => blockquote > p:fresh; your rules are added to the defaults. Most users never need this; for a one-off migration of a heavily-templated corpus it can be the difference between a clean output and one that needs hours of post-processing.

Browser-Only Conversion and the Privacy Posture

The whole conversion happens locally. mammoth.js is bundled into the page (about 493KB minified, loaded on demand the first time you convert a file). When you drop a .docx file in, it is read into a browser Blob via FileReader, parsed by mammoth.js as a zip archive, walked as XML, turned into HTML through the style map, and converted to Markdown by the same converter the HTML to Markdown tool uses (mammoth's own Markdown writer is deprecated and cannot write tables). Nothing crosses the network. This matters for any document that contains internal information — personnel records, legal drafts, financial reports — where uploading the file to a server-side converter would be a small but real disclosure risk. The Network tab in your browser confirms no upload occurs.

Pair this with the rest of the UDT document-conversion cluster: DOCX Metadata Inspector for examining author, dates, and document properties before or after conversion, PDF to DOCX for the upstream PDF case, Markdown Preview for previewing the converted output, and HTML to Markdown for the HTML-source case.

Related tools

Frequently Asked Questions

Is the .docx file uploaded anywhere during conversion?+
No. mammoth.js is bundled into the page and runs in your browser. The .docx file is read locally via FileReader, parsed in memory, and converted to Markdown without ever crossing the network. The Network tab in your browser developer tools confirms no upload while the tool runs.
What structure does the converter preserve?+
Headings 1 to 6, paragraphs, bulleted and numbered lists (including nesting), links, bold and italic, tables (as GitHub-flavored Markdown tables, first row as header), images, and Quote-styled paragraphs as blockquotes. A test document converted this way parsed back with the marked library into exactly the same headings, lists, table cells, image and blockquote.
What does it drop?+
Direct character formatting (font family, color, size, highlight) since Markdown has no equivalent; page-level constructs (headers, footers, page numbers, multi-column layouts); tracked changes (the output is the accepted version); comments; and Word-equation-editor equations (these become a placeholder). For documents that rely heavily on any of these, the conversion will not be lossless and post-editing will be needed.
Can I use a custom Word style map?+
Yes. Open Custom style map (advanced) and add one mammoth.js rule per line, such as p[style-name='Callout'] => blockquote > p:fresh or r[style-name='Code Char'] => code. Lines starting with # are ignored, and your rules are added to the built-in defaults.
How are images handled?+
Embedded as data URIs inside the Markdown by default, which keeps the file self-contained. Choose Skip images to leave them out. There is no separate image export.
Does it handle tables with merged cells?+
Partly. Markdown tables cannot merge cells, so a merged cell becomes a single cell and the row is padded with empty cells to keep columns aligned. Check complex tables by eye, or keep them as HTML.
Are tracked changes preserved?+
No. The conversion uses the rendered (accepted) version of the document; tracked changes that have not been accepted or rejected are treated as if they were accepted. If the tracked-change history is part of what you need to preserve, this tool is not the right fit — export the document with revisions visible from Word first, or use a tool that exposes the revision history explicitly.
What is the file-size ceiling?+
There is no fixed limit; the file is processed in your browser's memory. Documents with many large images make big Markdown files because each image is inlined as base64; choose Skip images if you only need the text.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service