Overview
Converts a Word .docx document into clean HTML and GitHub-flavoured Markdown at the same time. Headings, bold and italic text, lists, tables, links and images are kept, while Word's styling noise is left out. You can preview the result, copy either format, or download the files and images together as a ZIP. Nothing is sent anywhere; mammoth runs in your browser.
How It Works
Drop a .docx file of up to 50 MB. The tool shows a preview of the converted document, and the HTML and Markdown tabs show the source. Choose how images are handled: embedded as base64 data inside the HTML, saved as separate image files in a ZIP with the links rewritten to images/image1.png and so on, or removed. Buttons copy the HTML or Markdown, download a standalone .html page or a .md file, or download everything as one ZIP.
Step-by-Step Usage Guide
- Drop the .docx file onto the page.
- Choose whether images are embedded, saved as separate files or removed.
- Check the preview, then switch to the HTML or Markdown tab.
- Copy the format you need or download the .html, .md or ZIP file.
Technical Specifications & Standards
mammoth reads the document's structure rather than its appearance: paragraphs styled Heading 1 to Heading 6 become h1 to h6, list paragraphs become ul and ol, and Word tables become HTML tables. Direct formatting such as fonts and colours is ignored on purpose, which is why the output is clean enough to paste into a CMS or static site. The HTML is then parsed with DOMParser and passed through an allow-list sanitizer that drops scripts, frames, forms and event-handler attributes. The Markdown converter walks that HTML and writes ATX headings, nested list indentation, pipe tables, inline code and links, escaping characters such as asterisks and underscores so they are not misread as formatting. Conversion notes from mammoth, such as unrecognised styles, are listed under the output. Old binary .doc files are not supported and must be re-saved as .docx first. The preview runs in a sandboxed frame with scripts disabled.
Targeted Use Cases
- Publishing a Word draft to a blog, CMS or static site generator.
- Moving documentation from Word into a Git repository as Markdown.
- Pulling all embedded pictures out of a Word file as separate image files.
- Cleaning a document of inline Word styling before handing it to a web developer.
Notes & Gotchas
- Use Word's built-in Heading styles in the source so headings convert to real h1 to h3 tags.
- Choose separate image files for Markdown, since base64 images make .md files very large.
- Review the conversion notes for styles mammoth did not recognise.
Frequently Asked Questions
How do I convert a Word document to Markdown?
Drop the .docx file, open the Markdown tab, then copy it or download the .md file. Headings, lists, links, tables and emphasis are converted to their Markdown equivalents.
Where do the images go?
By default they are embedded in the HTML as base64 data. Choose Separate files to get a ZIP containing the HTML, the Markdown and an images folder, with links pointing to those files.
Why does the output lose my fonts and colours?
The converter keeps document structure, not visual styling, so the HTML stays clean and portable. Apply fonts and colours with your site's own CSS after converting.
Can it convert old .doc files?
No. Only the newer .docx format is supported. Open the .doc file in Word or LibreOffice, save it as .docx, then convert that copy here.
Related tools
- DOCX to HTML Converter - Convert Word .docx documents to clean HTML using Mammoth.js — no server required.
- HTML to Markdown Converter - Convert HTML into clean GitHub-flavored Markdown - headings, links, images, lists, code blocks, and tables - with Markdown-significant characters safely escaped.
- Markdown to Word (DOCX) Converter - Convert Markdown or a GitHub README into an editable Word .docx with real headings, numbered and nested lists, bordered tables, code blocks, links and embedded images, built in your browser.
- PDF to Word (DOCX) - Convert a PDF into an editable Word .docx file in your browser, with headings detected by font size, one section per page, and an exact-layout option that places each page as an image.
- HTML to Word (DOCX) Converter - Turn HTML into a Word .docx with headings, lists, tables, links and code kept as real Word styles. Scripts, styles and event handlers are removed first, and nothing leaves your browser.
- EPUB Reader & EPUB to Text / HTML / Markdown - Open a DRM-free EPUB in your browser, browse chapters from its table of contents, and export the whole book as plain text, Markdown or one self-contained HTML file. Scripts are stripped and nothing is uploaded.