How to convert markdown legal drafts to word .docx
- Step 1Assemble the draft into one file — If exhibits or schedules live in separate files, combine them with md-merger first — the converter takes one Markdown file per run.
- Step 2Redact before you export (if needed) — Strip API keys, client identifiers, or settlement figures with md-secret-redactor before generating the shareable .docx.
- Step 3Paste or upload the contract Markdown — Use Paste for a clause snippet or Upload for the full
.mddraft. The file is read locally — no transmission. - Step 4Click Run to build the .docx — docx.js writes built-in heading styles, decimal clause numbering, and italic recital blocks in one fixed pass.
- Step 5Open in Word and confirm numbering — Verify clause numbering at the top level reads correctly; apply Word's multilevel list style for any
1.1.1sub-numbering you need. - Step 6Send via your secure channel — Download
contract.docxand share through your usual privileged channel — the document is ready for Track Changes.
What survives the conversion
Every Markdown construct mapped to what md-to-docx actually writes into the .docx. Built with marked (tokenizer) + docx.js (document builder), both running in your browser. There are no conversion options — the mapping below is fixed.
| Markdown | In the .docx | Notes |
|---|---|---|
# H1 … ###### H6 | Word's built-in Heading 1–6 styles | Depths past 6 (#######) clamp to Heading 6 |
**bold**, *italic*, ~~strike~~ | Bold, italic, strikethrough runs | Combine freely in body paragraphs and headings |
inline code | Courier New run at 9pt | No background shading or colour — just the monospace font |
Fenced ``` ``` blocks | One Courier New 9pt paragraph per line | No syntax highlighting (Word has no native code highlighter) |
> blockquote | Italic paragraph indented 0.5" (grey 666666) | Indent is fixed at 720 twips |
[text](url) | Blue (0563C1) underlined hyperlink | Real clickable link, not just styled text |
GFM | table | | Native Word table, bold header row, 1pt borders | Columns share a 9000-twip width evenly; cells are plain text |
- item / 1. item | Word bullet / decimal-numbered list | Top level only — see nesting note below |
--- (horizontal rule) | Paragraph with a bottom border | Acts as a thin grey divider line |
 | The alt text as plain text | No image is embedded — see the images edge case |
Tier limits for the Markdown family
md-to-docx counts as a Markdown-family tool. Two independent limits apply: total file size in bytes AND a character count (charLimit). The converter accepts a single file per run (no batch).
| Plan | Max file size | Max characters | Files per run |
|---|---|---|---|
| Free | 1 MB | 500,000 | 1 |
| Pro | 10 MB | 5,000,000 | 10 (family) — md-to-docx still takes 1 at a time |
| Pro-media | 50 MB | 20,000,000 | 50 (family) — md-to-docx still takes 1 at a time |
| Developer | 500 MB | Unlimited | Unlimited (family) — md-to-docx still takes 1 at a time |
Contract constructs: Markdown to Word
How common legal drafting patterns translate, and what to check before sending to counsel.
| Drafting pattern | Markdown | Result in Word |
|---|---|---|
| Top-level clause numbering | 1. / 2. ordered list | Decimal-numbered Word list (level 0) |
Sub-clause 1.1.1 | Nested ordered list | Folds into parent item — apply Word multilevel list |
| Recital / WHEREAS block | > WHEREAS … | Italic paragraph indented 0.5" |
| Defined-term emphasis | **Term** | Bold run in the body paragraph |
| Cross-reference link | [Section 4](#s4) | Blue underlined hyperlink |
Footnote [^1] | Footnote marker + definition | Plain text, not a Word footnote |
Cookbook
Contract-drafting fragments and exactly what lands in the .docx. Party names and figures are placeholders.
Numbered clauses keep their numbers
A top-level ordered list of obligations converts to a decimal-numbered Word list, ready for redline.
Markdown: 1. The Vendor shall deliver the Services. 2. The Client shall pay within thirty (30) days. 3. Either party may terminate on notice. In the .docx (decimal Word list): 1. The Vendor shall deliver the Services. 2. The Client shall pay within thirty (30) days. 3. Either party may terminate on notice.
Recitals as italic indented blocks
Block quotes render as the italic, indented paragraphs lawyers use for recitals.
Markdown: > WHEREAS the parties wish to set out the terms; > WHEREAS each party has authority to enter this Agreement; In the .docx: (italic, indented 0.5") WHEREAS the parties wish to set out the terms; WHEREAS each party has authority to enter this Agreement;
Defined terms stay bold
Inline bold survives so defined terms read as drafted.
Markdown: **Confidential Information** means any non-public data. In the .docx: Confidential Information means any non-public data. ^^^^^^^^^^^^^^^^^^^^^^ bold run
Sub-clause numbering needs a Word list style
A nested sub-clause list does not become its own indented level — plan to apply Word's multilevel list after conversion.
Markdown: 1. Payment Terms 1. Net 30 from invoice date 2. Late fee of 1.5% per month In the .docx (nested folds into the parent item): 1. Payment Terms 1. Net 30 from invoice date 2. Late fee... Fix: in Word, select the items -> Multilevel List -> 1.1 style.
Redact, then export
Remove sensitive identifiers before producing the share copy.
Workflow:
1. md-secret-redactor: strip client codes / settlement $$
draft.md -> draft.redacted.md
2. md-to-docx: draft.redacted.md -> draft.redacted.docx
3. Send to opposing counsel for redlineEdge cases and what actually happens
Deeply nested lists don't get separate Word sub-levels
By designThe converter emits Word list paragraphs for top-level clauses only. A nested sub-clause list (your 1.1, 1.1.1) is folded into the parent clause's text rather than getting its own indented Word level, so automatic 1.1.1 numbering won't appear. Top-level clause numbers are correct; for full sub-clause numbering, select the items in Word and apply a Multilevel List style after conversion, or flatten the numbering in the source.
Footnotes are not turned into Word footnotes
Plain textThere is no footnote engine in this converter. Markdown footnote markers ([^1]) and their definitions are emitted as ordinary text in document order — they do not become Word's native footnotes at the bottom of the page. Convert footnote references to inline notes with md-footnote-linker first if you want predictable placement, then add Word footnotes manually if the recipient requires them.
Images are not embedded in the .docx
By design does not place a picture in the Word file. An inline image renders its alt text as plain text; a standalone image line renders as text too. No binary image data is fetched or embedded. After converting, insert images in Word via Insert → Pictures, or export your figures separately and add them where the alt text appears.
Bold/links inside a table cell render as plain text
Preserved as textGFM tables convert to real Word tables with a bold header row and 1pt borders, but cell contents are written as plain text. **bold**, [links](url), and ` code ` inside a cell keep their literal Markdown characters rather than becoming formatted runs. Keep table cells to plain values; put rich formatting in the surrounding body paragraphs, or style the cells in Word afterward.
Only one file converts per run
By designmd-to-docx takes a single Markdown source — paste it or upload one .md/.markdown/.mdx/.txt file. It does not merge multiple files into one Word document. To assemble several Markdown sections into one document, combine them first with md-merger, then run the merged file through md-to-docx.
YAML frontmatter is treated as document content
Watch outA --- delimited YAML frontmatter block at the top of the file is not stripped for this converter — marked sees the opening --- as a horizontal rule and the key/value lines as a paragraph, so your metadata can appear as visible text plus a divider line in the Word output. Remove frontmatter before converting, or build/clean it with md-frontmatter-builder and delete it before export.
Heading depth past level 6
Clamped to Heading 6Markdown allows ####### (seven hashes) but Word only has Heading 1 through Heading 6. Any heading deeper than six maps to Heading 6 rather than being dropped. If your document relies on a seventh level, restructure the outline or shift it up with md-heading-shifter before converting so the hierarchy reads correctly in Word's Navigation Pane.
Empty or whitespace-only input
ExpectedIf the source has no content, the converter still produces a valid one-paragraph .docx rather than erroring — you get an openable but empty Word file. Confirm you pasted or uploaded the right source if the result looks blank.
Privileged content and uploads
Stays localNo part of the draft is transmitted. marked and docx.js run in the browser tab, so privileged and attorney work-product content never reaches a server. The only server-side record for signed-in users is a usage counter (that a conversion occurred), with no document content.
Frequently asked questions
Can the recipient use Track Changes / comments on the result?
Yes. The output is a fully editable native .docx, so Review → Track Changes, comments, and accept/reject all work normally once the file is opened. There is nothing locked or read-only about the generated document.
Are numbered and bulleted lists preserved?
Top-level lists are: -/* become Word bullets and 1. lists become decimal-numbered Word lists. Nested sub-lists are folded into the parent item's text rather than getting their own indented Word sub-level. For deep multi-level numbering, flatten the list in Markdown or apply Word's multilevel list style after conversion.
Are footnotes converted to Word footnotes?
No. Markdown footnote markers ([^1]) and their definitions are emitted as plain text in document order, not as Word's native footnotes. For briefs that rely on footnotes, convert references to inline notes with md-footnote-linker first, then add Word footnotes manually where needed.
Will Word's Navigation Pane and outline view work?
Yes. Headings map to Word's built-in Heading 1–6 styles, so the Navigation Pane, outline view, and an inserted Table of Contents all pick them up automatically. After conversion you can add a ToC via References → Table of Contents and it will read the heading levels directly.
Will defined terms and cross-references format correctly?
Bold defined terms (**Term**) and italic emphasis carry across as runs, and Markdown cross-reference links become blue underlined hyperlinks. Note that text inside table cells is plain only — keep rich formatting in body paragraphs.
Can I apply my own corporate or template styles afterward?
Yes. Because headings use Word's standard built-in style names (Heading 1, Heading 2, …) rather than ad-hoc formatting, attaching a company template or changing the theme restyles the whole document at once. Open the .docx, then Design → Themes or attach your template via the Developer → Document Template dialog.
Can I keep my firm's contract template styling?
Yes. Headings use Word's built-in style names, so attaching your firm template restyles the whole agreement at once. Attach the template in Word after conversion (Design → Themes or attach a document template).
Does my document get uploaded to a server?
No. The whole conversion runs in your browser — marked tokenizes the Markdown and docx.js assembles the .docx locally. The file content never leaves your machine, so confidential drafts stay private. The only thing recorded server-side for signed-in users is a usage counter (that a conversion ran, not its contents).
What formatting options can I set before converting?
None — md-to-docx has no options panel. It uses a fixed, opinionated mapping (built-in heading styles, Courier New for code, blue underlined links, bordered tables). To change structure before converting, use the editing tools first: md-prettifier to normalize spacing, md-heading-shifter to fix the outline, or md-table-repair to align tables.
What is the output file named?
The downloaded Word file reuses the source name with the extension swapped to .docx — proposal.md becomes proposal.docx. If you pasted text instead of uploading a file, a default name is used. The document's internal title metadata is set from the filename, and the creator is recorded as "JAD Markdown".
Does the .docx open in LibreOffice and Google Docs?
Yes. docx.js writes a standards-compliant Office Open XML (.docx) file, so it opens in Microsoft Word, LibreOffice Writer, and Google Docs (via upload/import). Built-in heading styles and the table grid carry across all three; minor spacing differences between apps are normal.
Is there an API or command-line way to run this?
Not for the .docx output. The public API and MCP run the text-output Markdown tools server-side, but binary-output tools (md-to-docx, the md-to-pdf converters, md-splitter) return a 400 that points back to the web tool — Word generation only happens in the browser. For an automatable, text-only export use md-to-html or md-to-github-html and convert HTML to Word in your pipeline.
Privacy first
All Markdown processing runs locally in your browser using JavaScript. No file is ever uploaded to JAD Apps servers — only metadata counters are saved for signed-in dashboard stats.