Markdown & AI to Word

Convert ChatGPT, Claude & Markdown into formatted .docx with native editable equations

Pro tip: Tell AI: "Please reply in Markdown and wrap the content in a Markdown code block."

Why FormalDoc

Markdown and AI drafts to real, editable Word (.docx) documents

Copying from ChatGPT, Claude, DeepSeek, or Gemini directly into Word usually breaks headings, flattens tables, and turns math into plain LaTeX strings. FormalDoc converts Markdown or pasted AI rich text into properly styled .docx files right in your browser.

Native Editable Word Equations (OMML)

Inline ($E = mc^2$) and block ($$...$$) LaTeX formulas are compiled via MathML into native Word OMML equations—editable inside Microsoft Word and WPS instead of static screenshots.

Named Word Styles & 8 Formal Templates

Paragraphs, lists, blockquotes, tables, and headings map to real Word named styles (Title, Heading 1–4, Body Text), including GB/T 9704 Chinese official layout, APA academic, business, and legal presets.

Smart AI Paste & Structure Cleanup

Paste rich text directly from AI chats to normalize headings, nested lists, GFM tables (including <br> line breaks), code blocks, footnotes, and double-escaped AI LaTeX backslashes.

100% Browser-Local, Open Source & CLI

Your text never leaves your device—no account, no upload, and works offline. Prefer scripts or terminals? Run the exact same engine via npm or npx formaldoc.

Built-in Word Templates

Every preset configures heading hierarchy, body fonts, line spacing, first-line indentation, and page numbering, and can be fine-tuned in Customize Styles.

TemplateBody Font & SpacingBest For
Standard (en-standard)Times New Roman 12pt · 1.5 spacing · No indent · Arial headingsGeneral English reports, handouts, and clean everyday documents
Business (en-business)Calibri 11pt · 1.15 spacing · No indent · Arial headingsModern corporate proposals, memos, and client deliverables
Academic (en-academic)Times New Roman 12pt · Double-spaced · First-line indentAPA-style essays, research drafts, and university coursework
Legal (en-legal)Times New Roman 12pt · 1.5 spacing · No indent · 1.25 in left marginContracts, agreements, briefs, and formal legal filings
CN Government (cn-gov)FangSong + Times New Roman 16pt · Fixed 28pt spacing · First-line indent · Dash page numbersGB/T 9704-2012 Chinese official notices, memos, and reports
CN General (cn-general)SimSun + Times New Roman 12pt · 1.5 spacing · No indentEveryday Chinese technical notes and bilingual docs
CN Academic (cn-academic)SimSun + Times New Roman 12pt · 1.5 spacing · First-line indent · 1.25 in left marginChinese theses, journal manuscripts, and technical papers
CN Report (cn-report)SimSun + Times New Roman 12pt · 1.5 spacing · First-line indentChinese business reviews, project plans, and work summaries

Supported Markdown, Math & Formatting Details

Designed around real AI output and technical writing—not stripped-down plain text export.

  • $...$ & $$...$$Inline & Block LaTeX Math

    Fractions, roots, sums, integrals, Greek letters, matrices, and cases convert to native Word OMML math. Includes one-click fix for escaped \\frac formulas copied from AI.

  • | col | col |GFM Tables with <br> Line Breaks

    Markdown tables render with styled headers and borders, and inline <br> tags inside cells create real multi-line breaks in Word.

  • [^1]Native Word Footnotes

    Markdown footnote references and definitions map to real Word footnotes rather than plain bracketed text.

  • # – #####Flexible Title Level Mapping

    Choose whether H1 (#) or deeper headings (H2–H5) become the document Title, shifting lower levels automatically.

  • - / 1. / > / ```Nested Lists, Quotes & Code

    Multi-level ordered/unordered lists, blockquotes, links, strike-through, and fenced code blocks preserve hierarchy cleanly.

  • Auto / PlainSmart AI Paste & Text Cleanup

    Automatically parses copied AI HTML into Markdown (with one-click revert to plain text), plus tools to convert Chinese quotes, strip bold/italic markers, or remove CJK spacing.

Frequently Asked Questions

Are LaTeX formulas exported as images or real editable Word equations?

They are exported as real, native Word equations (OMML). FormalDoc converts LaTeX into MathML via KaTeX and transforms it into Office Math Markup Language inside the .docx file, so you can double-click and edit fractions, integrals, matrices, and Greek symbols directly in Microsoft Word or WPS.

How do I paste from ChatGPT, Claude, DeepSeek, or Gemini without losing formatting?

Copy the AI answer using its Copy button (or highlight rich text directly) and paste it into FormalDoc. In Auto paste mode, rich HTML is normalized into clean Markdown including tables, headings, and lists. If an AI chat double-escapes backslashes inside math, click Fix escaping when prompted.

Does FormalDoc support Chinese GB/T 9704 official document formatting?

Yes. Select the CN Government (cn-gov) template. It uses GB/T 9704-2012 defaults: Song 22pt bold centered title, HeiTi/KaiTi/FangSong heading hierarchy, FangSong 16pt (Size 3) body text with first-line indentation, fixed 28pt line spacing, and "- 1 -" dash page numbers.

Is my document uploaded to a server or stored anywhere?

No. Everything runs locally in your browser using JavaScript—Markdown parsing, LaTeX-to-OMML conversion, and .docx packaging happen entirely on your device. No login is required, and it continues working offline once loaded.

Can I automate FormalDoc in scripts, CI, or AI coding agents?

Yes. FormalDoc is also published on npm as a Node.js library, CLI tool (npx formaldoc input.md -o output.docx -t en-standard), and reusable AI Skill under Apache-2.0.

Open Source, npm Package & CLI

Use the exact same conversion engine from your terminal or Node.js scripts (Apache-2.0):

npx formaldoc input.md -o output.docx -t en-standard