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.
Word file
Drop a .docx here
Word 2007 and later · one file at a time · nothing is uploaded
—
—
What the document carries
What the converter reported
Output view
Mapping and pictures
Preview
Converted
How to use
- Drop the .docx on the box, or use Choose file. The markup is there straight away, with nothing to press.
- Read the list of what the document carries. Anything not carried is named there.
- The preview opens first. Check that headings look like headings and that your tables kept their rows.
- Switch the view to HTML to read the markup itself, one block per line. 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.
Above the result, a list of what the document carries names each part with the tag it becomes, and says plainly when something is not carried, like a header or a footer Mammoth never opens. Underlined words keep a u tag, and a paragraph styled Title becomes an h1. Pictures come through as base64 data URIs by default, which keeps the result self-contained; Images as files saves them beside the page in a ZIP instead.
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 the moment it lands, and the preview looks right until the third heading, which reads as ordinary body text. The HTML view 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, drop it 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 and multi-column layout are dropped, which leaves your own stylesheet in charge of how the page ends up looking. Underline is the exception: it is kept as a u tag unless you switch Keep underline off.
- Content outside the main text flow may not convert the way it looks. A text box's words are read as a paragraph after the one that holds it, and headers, footers and comments are not read at all; the list names the header and footer text it found.
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. By default they ride along as base64 data URIs inside the img tags, so the output is one self-contained file, at the cost of size. Turn on Images as files and each picture is saved as images/image1.png and so on, with the page and its pictures downloaded together as a ZIP.
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 reads the first eight bytes as the file lands, 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 →
Tell someone who needs this.