Word to Markdown

Drop in a .docx and get clean Markdown — headings, lists, tables, bold and links preserved, images optional. The file never leaves your browser.

Drop a .docx here, or click to choose

Word, Google Docs (File → Download → .docx), Pages, or LibreOffice exports · stays on your device

A Word to Markdown converter that runs in your browser

A .docx file is a zip of XML. This converter opens it with mammoth, a library built to turn Word documents into clean, semantic HTML — it reads paragraph styles rather than visual formatting, so a "Heading 2" becomes an h2 whatever font it uses. That HTML then goes through the same HTML-to-Markdown engine as our other tools (Turndown with GitHub-flavored Markdown support), plus a Word-specific cleanup pass. The whole DOCX to Markdown conversion happens on your device; nothing is uploaded.

The cleanup is where most online DOCX to Markdown converters fall short. Word's table of contents turns into a nested list of working links (with the page numbers removed), internal cross-references point at the right heading anchors, footnotes and endnotes become Markdown footnotes ([^1]), code styles and monospace paragraphs become fenced code blocks, and ☐/☒ checkboxes become task lists.

How to convert DOCX to Markdown

  • Open the document. Drop a .docx onto the box or click to choose one. From Google Docs, use File → Download → Microsoft Word (.docx) first.
  • Pick how images and tables come out. Embedded base64 keeps everything in one file; separate files keep the Markdown readable. HTML tables keep merged cells.
  • Match your style. Choose # or underlined headings, the bullet character, and _ or * for emphasis. Options re-run the conversion instantly and are remembered.
  • Copy or download. Check the rendered preview, tweak the text if you like, then copy it or save the .md (or a .zip with its images).

What carries over when you convert Word to Markdown

  • Heading 1–6 and Title styles → # headings; bold, italic, strikethrough → **, _, ~~
  • Bulleted and numbered lists, nested to any depth, with start numbers kept
  • Tables → GitHub-flavored pipe tables (first row as header), or HTML tables with merged cells
  • Hyperlinks, including links to headings inside the document
  • Images → base64, separate files, or nothing; alt text is kept
  • Footnotes and endnotes → [^n] references with their text at the end
  • Quote and Block Text styles → > block quotes; code styles and monospace text → ` and ``` code
  • Superscript and subscript → <sup> and <sub>

What doesn't: fonts, colors, sizes, alignment, headers and footers, comments, and tracked changes (only the current text is converted). Shapes, SmartArt, and equations may be skipped.

Pandoc: convert DOCX to Markdown from the command line

For batches or scripts, Pandoc is the standard DOCX to Markdown converter. Install it with brew install pandoc or winget install pandoc, then:

# github-flavored markdown, images saved to ./media
pandoc -f docx -t gfm --wrap=none --extract-media=./media input.docx -o output.md

# pandoc's own markdown flavor (grid tables, definition lists)
pandoc -f docx -t markdown --wrap=none input.docx -o output.md

# convert a whole folder of word documents
for f in *.docx; do pandoc -f docx -t gfm --wrap=none "$f" -o "${f%.docx}.md"; done

Tip: without --wrap=none, Pandoc hard-wraps paragraphs at 72 characters, which makes diffs of the Markdown noisy. With -t gfm, tables that can't be pipe tables (merged cells, several paragraphs in a cell) are written as HTML.

Python: mammoth, MarkItDown, and pypandoc

# pip install mammoth markdownify
import mammoth
from markdownify import markdownify

with open("input.docx", "rb") as f:
    html = mammoth.convert_to_html(f).value
open("output.md", "w").write(markdownify(html, heading_style="ATX"))

# pip install 'markitdown[docx]'   — microsoft's all-in-one converter
from markitdown import MarkItDown
print(MarkItDown().convert("input.docx").text_content)

# pip install pypandoc_binary
import pypandoc
pypandoc.convert_file("input.docx", "gfm", outputfile="output.md",
                      extra_args=["--wrap=none", "--extract-media=media"])

MarkItDown also has a CLI — markitdown input.docx -o output.md— and is popular for feeding Word files to LLMs. Mammoth's own Markdown output is deprecated, which is why the HTML → markdownify route is the usual recipe.

Tips for clean Markdown from Word

  • Use Word's real heading styles (Home → Styles) rather than big bold text — they become proper # headings.
  • Accept or reject tracked changes before converting; the converter only sees the current text.
  • If a document is mostly a table of figures, try the HTML table mode and compare.
  • For docs you'll paste into an LLM, drop images — base64 data is large and useless to a text model.
  • Going the other way? The Markdown to Word converter writes styles that this tool reads back, so documents round-trip.

Frequently asked questions

How do I convert a Word document to Markdown?

Drop the .docx file onto the converter above (or click to choose it). The Markdown appears instantly — copy it, or download it as a .md file. Headings, bold and italic, lists, tables, links, footnotes, and images all carry over. You can also paste formatted text straight from Word or Google Docs.

Is this DOCX to Markdown converter free and private?

Yes. It's free with no signup, and the conversion runs entirely in your browser — the document is never uploaded to a server, so it's safe for internal or confidential files.

Can I convert an old .doc file to Markdown?

Not directly: .doc is the binary Word 97–2003 format, which browsers can't read. Open it in Word and choose File → Save As → Word Document (.docx), or upload it to Google Drive, open it with Google Docs, and use File → Download → Microsoft Word (.docx). Then drop the .docx here.

How do I convert Google Docs to Markdown?

Google Docs can export Markdown itself (File → Download → Markdown). For more control — images as separate files, HTML tables for merged cells, footnotes — download the doc as .docx (File → Download → Microsoft Word) and convert it here, or copy the text in Google Docs and paste it into the paste box.

What happens to images in my Word document?

You choose: embed them in the Markdown as base64 data URLs (one self-contained file), extract them as separate files (download a .zip with the .md and an images/ folder, or save them one by one), or leave them out. EMF and WMF images — common for charts pasted from Excel — are flagged, since browsers can't display them.

How are tables with merged cells converted?

Markdown tables can't merge cells, so by default merged cells are laid out on a grid with the spanned slots left empty, keeping every column aligned. Switch tables to HTML to keep colspan and rowspan exactly — most Markdown renderers, including GitHub, display HTML tables.

How do I convert DOCX to Markdown with Pandoc?

Run pandoc -f docx -t gfm --wrap=none --extract-media=./media input.docx -o output.md. -t gfm writes GitHub-flavored Markdown, --wrap=none stops Pandoc hard-wrapping lines at 72 characters, and --extract-media saves the document's images into a folder and links them from the Markdown.

Is there a Python library to convert Word to Markdown?

Yes: mammoth (pip install mammoth) converts .docx to clean HTML, which markdownify turns into Markdown; Microsoft's MarkItDown (pip install 'markitdown[docx]') wraps the same idea in one call — MarkItDown().convert("input.docx").text_content; and pypandoc gives you Pandoc from Python. This page uses the JavaScript version of mammoth.

Why did some formatting disappear?

Markdown only has structure — headings, emphasis, lists, tables, links, code — so fonts, colors, sizes, underline, and alignment have nowhere to go. Custom paragraph styles are reported in the conversion notes. If your headings came out as bold text, the document used bold instead of heading styles; tick "Bold one-line paragraphs → headings".

Related free tools

See all free tools →

Built something? Put it online in seconds

host0 is the cloud for small software: bring any coding agent, build the tool only you need — like this one — and say "deploy to host0". Live at a shareable URL, no servers to run.