Convert DOCX to HTML without Word’s messy markup
This DOCX to HTML converter turns a Word document into clean, semantic HTML you can paste into a CMS, a blog, a help centre or an e-mail template. Headings become <h1>–<h6>, lists become <ul> and <ol>, tables keep their header rows, and bold, italic, underline, links and footnotes come through — without the inline styles, class names and conditional comments that Word’s own “Save as Web Page” produces.
Conversion uses mammoth (BSD-2-Clause licence), an open-source library that maps Word styles to HTML elements rather than copying visual formatting. That is why the result is tidy, and why you can teach it your own styles with a style map: a “Note” paragraph style can become an <aside>, a “Code” style a <pre> block.
The file is opened and converted in your browser. Nothing is uploaded, so internal documents and drafts stay private.
How to use the DOCX to HTML Converter
- Drop a .docx file on the upload area or click it to choose one.
- Choose what happens to pictures: embedded in the HTML as Base64, saved as separate files in a ZIP next to the HTML, or left out.
- Pick a full HTML page with a simple stylesheet, or body content only for pasting into a CMS. Tick the options for indented code, heading IDs and empty paragraphs.
- Check the Preview, or switch to HTML code to read the markup. The conversion notes list any Word styles that had no mapping.
- Press Copy HTML, or Download to save the .html file (or the .zip with images).
DOCX to HTML Converter features
Semantic output
Real headings, paragraphs, nested lists, tables with a header section, links, footnotes and endnotes — and no font tags or inline CSS to clean up afterwards.
Images your way
Embed pictures as data URIs for one self-contained file, or export them as images/image1.png and so on in a ZIP next to the HTML, which keeps the page small and the images cacheable. Alt text is kept.
Custom style map
Edit the mapping rules to turn Word styles such as Title, Quote, Intense Quote or your organisation’s own styles into the HTML tags and classes your site expects.
Readable code
Pretty-printing indents nested lists and tables so the markup is easy to review; switch it off for compact HTML.
Anchor-ready headings
Optional IDs such as id="project-goals" let you link to any section or build a table of contents.
Sandboxed preview
The result is shown in a sandboxed frame with scripts disabled, so even an unusual document can’t affect this page.
What converts — and what doesn’t
| Word feature | HTML result |
|---|---|
| Heading 1–6 styles, Title | <h1>–<h6>; Title becomes <h1 class="title"> |
| Bulleted and numbered lists | <ul> and <ol>, nested by level |
| Tables | <table> with header rows in <thead>; merged cells use colspan and rowspan |
| Bold, italic, underline, strikethrough, superscript, subscript | <strong>, <em>, <u>, <s>, <sup>, <sub> |
| Hyperlinks and bookmarks | <a href> links and in-page anchors |
| Footnotes and endnotes | Numbered links to a list of notes at the end |
| Pictures | Base64 <img>, separate files, or nothing |
| Fonts, colours, sizes, page layout, text boxes, charts | Not converted — style the page with your own CSS |
Writing a style map
Each line of the style map says “this Word style becomes this HTML”. p[style-name='Quote'] => blockquote > p:fresh wraps Quote paragraphs in a block quote; r[style-name='Code Char'] => code turns a character style into inline code; p[style-name='Warning'] => div.warning > p:fresh adds a class you can style. Style names must match the names in Word’s Styles pane.
After converting, the conversion notes list every style that had no rule — the quickest way to see what to add. Press Apply style map to convert again with your changes.
Where to use the HTML
- WordPress, Ghost, Shopify and other CMSs: choose “Body content only”, copy the HTML and paste it into the code or HTML block.
- Static sites and documentation: download the ZIP so images live as separate files, or go on to Markdown with HTML to Markdown.
- Smaller pages: compress the result with the HTML Minifier.
- Back to Word: edited HTML becomes a .docx again with HTML to DOCX.
DOCX to HTML Converter FAQ
How do I convert a Word document to HTML?
Drop the .docx on the converter, choose how images and the page should be saved, then copy the HTML or press Download. It takes a second and needs no account.
Why doesn’t the HTML look exactly like my Word document?
The converter keeps the structure — headings, lists, tables, emphasis — and leaves out fonts, colours and page layout, which belong in your site’s CSS. That gives clean markup instead of thousands of inline styles.
Are images included?
Yes. By default they are embedded as Base64 data, so the HTML file is self-contained. Choose “Separate files in a ZIP” to get them as image files, or “Leave out” to skip them. Windows EMF/WMF drawings are kept, but browsers can’t display them.
Can I convert .doc or .odt files?
Only .docx is supported. Save older .doc files or OpenDocument .odt files as .docx in Word, LibreOffice or Google Docs first.
Is the conversion private?
Yes. The document is read by JavaScript in your browser and never uploaded, and the preview runs in a sandbox with scripts disabled.
What is the style map for?
It tells the converter which HTML to produce for each Word style. The defaults handle common styles such as Title and Quote; add your own rules for custom styles, for example to turn a “Tip” style into a styled box.