DOCX to HTML
DOCX to HTML with semantic tags and none of Word's span soup. Preview it, copy the markup, or save a styled standalone page.
Runs entirely in your browser — your files and text never leave your device.
Drag & drop your file here, or
How to use
- Pick the .docx. Drag it onto the box or use Choose file, whichever is quicker.
- Hit Convert to HTML. A long document takes a moment while Mammoth unzips the file and walks its XML.
- The Preview tab opens first. Check that headings look like headings and that your tables kept their rows.
- Switch to the HTML tab to read the markup itself. Anything you styled from Word's style menu shows up as a real tag here; anything you formatted by eye shows up as a plain p.
- Use the copy button if you are pasting into a CMS or an email template. It gives you body markup only, with no html or head wrapper.
- Take Download .html if you want a file you can open on its own. It saves under the source name with the extension swapped, so brief.docx becomes brief.html.
About this tool
Word's own Save as Web Page output is notorious: conditional comments, mso- prefixed properties, spans wrapped around single characters. DOCX to HTML takes the other route. Mammoth rebuilds the document from its structure, so a paragraph styled Heading 2 becomes an h2 and a bulleted list becomes a ul, nested up to five levels deep if that is how it was written.
Pictures embedded in the document come through as base64 data URIs inside the img tags. That keeps the result to a single self-contained file, and for a photo-heavy report it also makes that file very large. The Output view toggle above the result switches between the rendered preview and the source, and each pane scrolls inside its own 32rem window rather than pushing the rest of the page down.
Copy HTML hands over the inner markup on its own, ready to paste inside a template you already have. Download .html wraps that same markup in a small complete page you can open directly. If Markdown suits the job better, DOCX to Markdown feeds this exact HTML through Turndown, and DOCX to Text throws the tags away and keeps the words.
From a Word draft to the CMS, with one lesson on the way
A 2,000-word draft with two photos converts in a beat, and the Preview tab looks right until the third heading, which reads as ordinary body text. The HTML tab explains it: that one was never given a heading style in Word, just bolded and enlarged by eye, so Mammoth honestly calls it a p.
Apply Heading 2 to it back in Word, convert again, and the outline is clean. Copy HTML then hands the CMS a fragment with real h2s, real lists and the photos riding along as data URIs, and the site's own stylesheet takes it from there.
Good to know
- Fidelity is traded for cleanliness on purpose. Word colours, fonts, multi-column layout and text boxes are dropped, and underlined text loses its underline because Mammoth has no default tag for that one, which leaves your own stylesheet in charge of how the page ends up looking.
- Content that lives outside the main text flow can convert to nothing at all. A flyer built from text boxes comes back empty, and the status line reports that no readable content was found rather than inventing a layout for it.
Frequently asked questions
Will my own stylesheet be able to take over?
That is the whole design. The markup carries no inline style attributes, just h1 through h6, p, ul, ol, table, a and the emphasis tags, so the CSS you already have applies to it directly with nothing to override first.
My Word file has photos in it. Do they survive?
They do, as base64 data URIs inside the img tags, which is what makes the output self-contained with no image folder to ship alongside it. The cost is size: a document with a dozen photos can produce several megabytes of HTML. Swap the data URIs for real file paths if that matters.
Does the download give me a whole page or just the fragment?
Two different things. The copy button hands over the body markup alone. The download wraps it in a complete page with a doctype, a UTF-8 charset, a viewport meta tag, your filename as the title, and a couple of dozen CSS rules that set a 48rem measure, a system font stack and bordered tables.
Where do my footnotes end up?
At the bottom of the converted document as a numbered list, each entry linked back to the sentence that cited it. The superscript markers in the text become plain links, which most stylesheets render small and raised anyway.
Does it read .doc files from Word 2003?
No. Those are a binary format from before OOXML existed and nothing here can open one. The check runs as soon as you press Convert to HTML, and the message tells you to re-save. Google Docs will do that conversion for free if Word isn't to hand.
Missing something in DOCX to HTML? Suggest a feature →