DOCX to HTML converter

Convert a .docx file to HTML in a second. You get the document's structure as plain tags (<h1>, <ul>, <table>), ready to paste into a CMS, an email template or a static site, with a live preview next to it. Nothing is uploaded.

or drop a .docx on this box

Open a .docx file to start.

HTML

Preview

What is kept

In your Word fileIn the HTML
Headings and the Title style<h1> to <h6>
Only paragraphs that use Word's Heading styles count as headings, not text that is merely large and bold.
Bold, italic, strikethrough, links<strong>, <em>, <s>, <a>
Bulleted and numbered listsKept, with nesting
TablesPlain <table>, no widths or colors
Footnotes and endnotesNumbered links to a list of notes 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 HTML as a data: URI, so you get one self-contained file, but large photos make it long. Files (ZIP) downloads a ZIP with the .html file and an images/ folder (image1.png, image2.jpeg…) that the HTML 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, Word to Markdown, DOCX 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

HTML to DOCX · DOCX to Markdown · DOCX to PDF Converter · Markdown to DOCX · PDF to DOCX · PDF to HTML · HTML to image · HTML to PDF · HTML formatter · Word to HTML · HTML to Markdown · HTML to Word · Markdown to HTML · Online HTML editor · HTML viewer · HTML Beautifier · HTML Decode · HTML Encode · all free tools