Browser-based document converter · DOCX to HTML

Word to HTML Converter

Produces clean semantic HTML from a .docx, as a complete page or as a body fragment to paste into a CMS.

Input

Word files (.docx), up to 25MB

Drop your DOCX file here or click to choose

.docx

Files are read and converted on your device. Nothing is uploaded, and the result is yours to download or open in the Word editor.

Result

HTML file, ready to download or edit

Choose a file to see the HTML result here.

Word to HTML Converter

Operator: Abdulla Al Fahad. How tools are built and checked

Pasting from Word into a web editor drags along thousands of characters of mso- styles, font tags and nested spans, and Word's own Save as Web Page is worse. The Word to HTML Converter produces the markup a web developer would write by hand: h1 to h3, p, ul and ol, table with th and td, strong, em, u, s, code and pre, blockquote and a. No class attributes and, for a Word document, no inline styles at all.

The two output modes match the two things people do with the HTML. Complete HTML page gives a file with a charset declaration, the document title and a short stylesheet, so it opens readably in a browser or can be attached to an email. Body content only gives just the markup between the body tags, which is what you paste into the code view of WordPress, a newsletter tool or a help-centre editor. The preview can be switched between the rendered page and the HTML code, and the Copy button copies the code.

Key features

  • Semantic HTML only: h1 to h3, p, ul, ol, li, table, th, td, strong, em, u, s, code, pre, blockquote and a, with no classes, inline styles or Word-specific markup.
  • Nested lists are written as lists inside li elements, and repeating header rows become th cells.
  • Complete page mode with charset, title and a small stylesheet, or body-only fragment mode for a CMS.
  • Rendered and code previews, a Copy button and an .html download.
  • Reports skipped images so you know how many img tags to add.

What the HTML contains

Word heading styles become h1, h2 and h3 (Heading 3 and deeper share h3, Title becomes h1, Subtitle h2). Body paragraphs become p, Quote styles become blockquote, lists become ul or ol with nested lists inside li, and tables become table with the header row as th cells when Word marks it as a repeating header row. Bold, italic, underline and strikethrough become strong, em, u and s. Text in Word's Code or HTML Preformatted style becomes code, or a pre block when it spans several lines. Hyperlinks become a elements with http, https or mailto addresses only.

The HTML is semantic structure only. Colours, highlights, font names, font sizes, alignment, headers, footers and page breaks are not included, which is exactly what most CMS editors want, because the site's stylesheet should decide how a heading looks. Empty spacer paragraphs are dropped by the Word reader, so there are no padding elements to clean up. Images are counted and reported but not embedded; a document with pictures needs them uploaded to the site separately. Footnotes and endnotes are written as a numbered list at the end of the content.

Complete HTML page wraps the content in a document with a UTF-8 charset, the document title, a viewport meta tag and a short embedded stylesheet with Arial 11pt text, bordered tables and a quote border. Body content only gives just the markup between the body tags, ready to paste into a CMS, a newsletter tool or a template.

How it works

After mammoth has produced the document structure, a serialiser writes each block as semantic HTML, escaping text and keeping only safe link addresses. Lists are tracked by depth so that a sub-list is written inside its parent li, the first row of a header table becomes th cells, monospace runs become code, and a multi-line monospace paragraph becomes a pre block.

In complete-page mode the body is wrapped in a document skeleton with a UTF-8 charset declaration, the title from the file name and a short stylesheet. The text is shown in a sandboxed preview, offered for copying and downloaded as a UTF-8 .html file.

Common use cases

  • A content editor pastes an article written in Word into a CMS without carrying over Word's formatting junk.
  • A marketing team converts a Word newsletter into HTML to drop into an email template.
  • A developer converts policy documents to HTML pages for an intranet.
  • A support team moves knowledge-base articles from Word into a help-centre editor.
  • A writer publishes a Word draft on a static site by pasting the fragment into a page template.

How to use this tool

  1. Drop a .docx file on the upload area.
  2. Choose Complete HTML page or Body content only. The output updates immediately.
  3. Switch between Rendered and HTML code to check structure and markup, and confirm the table header shows as th cells.
  4. Copy the HTML or download the .html file. Use Edit in Word editor if a heading or list needs fixing first.

Example

Word document

Heading 2: Opening hours
Normal: We are open **Monday to Friday**, 9 to 5.
Bullets: Closed on public holidays
         Email us at info@example.com (a mailto hyperlink in Word)

HTML output (body content only)

<h2>Opening hours</h2>
<p>We are open <strong>Monday to Friday</strong>, 9 to 5.</p>
<ul>
  <li>Closed on public holidays</li>
  <li>Email us at <a href="mailto:info@example.com">info@example.com</a></li>
</ul>

Tips for best results

  • Use Word heading styles. They are the only source of h1 to h3 in the output.
  • Choose Body content only when pasting into a CMS, newsletter editor or template, and Complete HTML page when you want a file that opens in a browser.
  • To get th cells, select the first row of the table in Word and turn on Layout, Repeat Header Rows; the Table Design colour option does not mark a header row.
  • Switch the preview to HTML code to inspect the markup, or to Rendered to check the structure visually.
  • Upload the document's pictures to your site and add img tags where the warning says they were skipped.

Edge cases to watch

Visual formatting is dropped on purpose: colour, highlight, font, size and alignment are not written, so a document whose meaning depends on red text or centred lines needs that expressed differently.

Headings deeper than Heading 3 all become h3.

Images and shapes are skipped, with a count in the warnings. Nothing marks their original position in the HTML.

Merged table cells become ordinary cells plus empty cells, because colspan and rowspan are not written.

Local file links and anchors inside the document are removed; only web and mail links remain.

Tracked changes appear as accepted, comments disappear, and footnotes move to a list at the end.

Frequently asked questions

Why are the colours and fonts from my document missing?

The output is deliberately semantic. Colours, fonts, sizes and alignment are left to the stylesheet of the site where the HTML is used, which is what CMS editors and email tools expect.

Which mode should I use for WordPress or another CMS?

Body content only. Paste it into the HTML or code view of the editor. The complete page mode is for a standalone file that opens in a browser.

Are images included?

No. The converter counts the images it skipped and shows the number in a warning. Upload the pictures to your site and add img tags where they belong.