DOCX to Markdown converter

Convert a .docx file to GitHub-flavored Markdown. Headings become #, lists keep their nesting, tables become GFM tables and images are saved as files in an images/ folder, so the result works in Git, Hugo, Jekyll, MkDocs or Obsidian. The file never leaves your browser.

or drop a .docx on this box

Open a .docx file to start.

Markdown

Preview

What is kept

In your Word fileIn the Markdown
Headings and the Title style#, ##…
Only paragraphs that use Word's Heading styles count as headings, not text that is merely large and bold.
Bold, italic, strikethrough, links**bold**, *italic*, ~~strike~~, [text](url)
Bulleted and numbered listsKept, with nesting
TablesGitHub-flavored tables
The first row becomes the header row, since GFM needs one.
Footnotes and endnotesGitHub footnotes: [^1] in the text, [^1]: note at the end
ImagesEmbedded as data URIs, saved as files in a ZIP, or removed
Old EMF/WMF vector images can't be shown by browsers and are left out.
Fonts, colors, sizes, alignment, headers and footersDropped
On purpose: the output is content you style yourself.

Why not Word's "Save as Web Page"?

Word can save a document as HTML, but that file is meant to be opened again in Word: every paragraph carries class="MsoNormal" and inline mso- styles, lists are often paragraphs with a bullet character and tab spans instead of <ul>, and the page starts with kilobytes of conditional comments and XML. Pasting that into a CMS or an email brings Word's formatting with it. This converter reads the document's structure instead (what is a heading, a list item, a table cell), using mammoth, and writes only plain tags, one block per line.

Images: embedded or as files

Embedded puts each image inside the Markdown as a data: URI, so you get one self-contained file, but large photos make it long. Files (ZIP) downloads a ZIP with the .md file and an images/ folder (image1.png, image2.jpeg…) that the Markdown links to with relative paths, which is what Git repositories, static site generators and most CMS uploads expect. Alt text set in Word is kept.

Convert Word files from code

The same library has a command line, so you can convert a folder of documents with no browser: npx mammoth report.docx report.html writes clean HTML with embedded images, and mkdir out && npx mammoth report.docx --output-dir=out writes out/report.html with the images as separate files (the folder must exist). One difference from this page: the command line turns Word's Title style into a plain paragraph unless you pass a style map. To turn .docx files into PDFs on a server without LibreOffice, send that HTML to the Shotmint PDF API: the Word to PDF page has a tested Node script. Each PDF is 1 credit; new keys get 25 free.

Get 25 free renders a month API docs

FAQ

Is my document uploaded? No. The .docx is read and converted by JavaScript in your browser, and the preview is a sandboxed frame that can't run scripts or load anything.

Does it work with .doc files? No, only .docx (Word 2007 and later, also what Google Docs and LibreOffice export). Open an old .doc in Word or LibreOffice and save it as .docx first.

My headings came out as plain paragraphs. They were formatted by hand (bigger, bold) rather than with Word's Heading 1, Heading 2… styles. Apply the styles in Word and convert again; it also fixes the document's navigation pane.

Can I get a PDF instead? Yes: Word to PDF prints the same content to a PDF with selectable text.

Related: Word to HTML, DOCX to HTML, Word to Markdown, HTML to Word, Word to PDF, HTML to Markdown, Google Docs to Markdown, PDF to Markdown, HTML viewer, Markdown to PDF.

Related tools

Markdown to DOCX · DOCX to HTML · DOCX to PDF Converter · HTML to DOCX · PDF to DOCX · PDF to Markdown · Markdown to PDF · Google Docs to Markdown · Markdown table generator · CSV to Markdown table · HTML to Markdown · Markdown to Word · Markdown to HTML · Website to Markdown · Excel to Markdown Table · Markdown Table to CSV Converter · Markdown Viewer · Online Markdown Editor with Live Preview · all free tools