Word to HTML Converter – Clean HTML from Word and Google Docs
What is a Word to HTML Converter?
It turns a Word document into HTML you can put on a web page. You paste from Word (or open the .docx file), and you
get the same headings, bold text, lists, tables and links as plain tags like <h2>,
<strong>, <ul> and <table>.
The tricky part is the cleanup. When you copy from Word, it hands the browser a lot of extra code meant for Word
itself: class="MsoNormal" on every paragraph, mso- styles, hidden comments, empty
<o:p> tags, and bullets that are really just a "·" character in a Symbol font. This tool removes
all that and keeps what a website needs. It works the same for Google Docs, LibreOffice and web pages, and it all
runs in your browser.
Only have plain text? The Text to HTML converter is the simpler sibling of this page:
a paste there keeps just the words.
How to Convert Word to HTML – Step by Step
Click Sample in the tool above to see a short report that was copied from Word.
Step 1 Paste from Word or Google Docs
In Word, select the part you need (or press Ctrl+A for everything) and copy it. Click in the editor on this page
and press Ctrl+V (⌘+V on a Mac). The status line under the editor tells you where the paste came from and how many
Word styles and tags were cleaned up.
Want only the words, without any formatting? Press Ctrl+Shift+V instead and the paste comes in as plain
paragraphs.
Step 2 Or Open the .docx File
Click Open .docx or drag the file onto the page. Opening the file is the better choice when
your document has pictures: they come along as data: URIs, which means the image is written right
into the HTML and you don’t need to upload it anywhere. The status line shows how much the images add.
- Files up to 20 MB work. Big pictures make big HTML, so check the size before you use it in an email.
- Notes: if part of the file couldn’t be converted, a yellow note says what, like "Some Word
styles had no HTML match and were kept as plain paragraphs".
Step 3 Fix Anything You Like
The left panel is a real editor. Turn a line into a heading, fix a typo, add a link (Ctrl+K), or use the table
button to add rows and columns, merge cells or switch the header row on. The HTML on the right updates as you
type.
Step 4 Pick Your Options
- Full HTML page: wraps the code in a complete document with a doctype, head and body.
- Keep inline styles: off by default for clean code. Turn it on to keep text alignment and text
colors. Word’s own
mso- styles are never kept.
- Remove empty paragraphs: Word uses blank paragraphs for spacing. This drops them.
- Keep images: turn it off to get the text without any
<img> tags. - Indent code: one tag per line, neatly indented. Turn it off for compact HTML on one line. Our
HTML Formatter has more indent options.
Step 5 Copy or Download
Click Copy and paste the HTML into your website, CMS or email template, or click
Download for a full .html page named after your first heading. Switch to
Preview first if you want to see how a browser shows it. Your document stays in this browser
until you click Clear.
What Gets Cleaned Up
Here’s a bold line and a two-item bullet list, as Word really puts it on the clipboard, and what you get from this
tool:
What Word pastes:
<p class=MsoNormal><b><span lang=EN-GB style='font-size:12.0pt;
mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>Opening hours</span></b><o:p></o:p></p>
<p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;
mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:Symbol'><span
style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]>Monday to Friday: 8am to 6pm<o:p></o:p></p>
<p class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;
mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:Symbol'><span
style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]>Saturday: 9am to 1pm<o:p></o:p></p>
Clean HTML:
<p><strong>Opening hours</strong></p>
<ul>
<li>Monday to Friday: 8am to 6pm</li>
<li>Saturday: 9am to 1pm</li>
</ul>
- Removed:
class="Mso…", mso- styles, lang, fonts and sizes, margins, <o:p>, <xml> and <style> blocks, conditional comments like <!--[if gte mso 9]>, empty spans, and Word’s bookmarks. - Rebuilt: Word’s fake list paragraphs become real
<ul> and <ol> lists, nested by level. Numbers like "a." and "iv." keep their list type. - Renamed:
<b> to <strong>, <i> to <em>, Word’s Title style to <h1> and its Quote style to <blockquote>. - Kept: headings, paragraphs, bold, italic, underline, strikethrough, highlights, links, lists, tables with merged cells, images with a usable address, and alignment and colors (shown when Keep inline styles is on).
Google Docs to HTML: Tips
Copying from Google Docs works the same way: select, copy, paste. Docs has its own quirks, and the cleaner knows
them:
What Google Docs pastes:
<b style="font-weight:normal;" id="docs-internal-guid-4f1c...">
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;">
<span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;
background-color:transparent;font-weight:700;font-style:normal;
font-variant:normal;text-decoration:none;vertical-align:baseline;
white-space:pre-wrap;">Note:</span><span style="font-size:11pt;
font-family:Arial,sans-serif;color:#000000;font-weight:400;
white-space:pre-wrap;"> the shop opens late on Sunday.</span></p></b>
Clean HTML:
<p><strong>Note:</strong> the shop opens late on Sunday.</p>
- The whole paste sits in a
<b id="docs-internal-guid-…"> tag that says font-weight:normal. It isn’t bold, so it’s removed. - Bold, italic and underline are styles on spans (
font-weight:700), not tags. They become <strong>, <em> and <u>. - Nested lists come in a slightly broken shape (a list straight inside a list). They’re moved into the right list item.
- Links from a published doc often go through a google.com redirect. The real address is put back.
- Images in a Docs paste point to Google’s servers and may stop working later. For a page you’ll keep, download the doc as .docx (File > Download > Microsoft Word) and open that file here, so the images are built in.
What It Can’t Do
Word can do a lot that a web page can’t, so a few things don’t come along. Better to know up front:
- Old .doc files: only .docx works. Open a .doc in Word, Google Docs or LibreOffice and save it as .docx first.
- Images in a paste from desktop Word: Word gives the browser a
file:/// path to a temporary picture on your computer, and a web page isn’t allowed to read it. You’ll see a note when that happens. Open the .docx to keep the pictures. - Page layout: text boxes, columns, headers and footers, page numbers, page breaks, footnote placement and exact fonts and spacing aren’t kept. You get the content and its structure, and your website’s CSS does the styling.
- Tracked changes and comments: a .docx is converted as if every change was accepted, and comments are left out. Accept or reject the changes in Word first if that matters.
- Equations, charts and SmartArt: they don’t have a simple HTML version, so they’re dropped or come through as plain text.
- Alignment from a .docx: centered or right-aligned paragraphs come through when you paste, but not when you open the file. Use the align buttons to fix them.
Frequently Asked Questions
How do I convert a Word document to HTML?
Open the document in Word, select what you need (Ctrl+A for everything), copy it and paste it into the editor on this page. Or click Open .docx and pick the file. The left panel shows your document, and the right panel shows clean HTML that you can copy or download as an .html file.
Why not just use “Save as Web Page” in Word?
Word’s own HTML is made so Word can open the file again, not for a website. It’s full of class="MsoNormal", mso- styles, conditional comments, <o:p> tags and fonts on every line. A one-page letter can turn into hundreds of lines. This tool keeps the parts that matter (headings, bold, lists, tables, links, images) and drops the rest.
Can I convert Google Docs to HTML?
Yes. Copy from your Google Doc and paste it here. Google Docs wraps everything in a <b> tag that isn’t really bold and puts long inline styles on every span; the cleaner removes those and turns font-weight: 700 into <strong>, italic into <em>, and so on. You can also download the doc as .docx (File > Download > Microsoft Word) and open that file here.
Does it keep tables and images?
Tables are kept, including merged cells. If every cell in the first row is bold, that row becomes a header row with <th> cells. Images from a .docx file are kept as data: URIs, so they live inside the HTML. When you paste from desktop Word, images usually can’t come along, because Word only gives the browser a path to a temporary file on your computer. Open the .docx instead to keep them.
Can I open an old .doc file?
Not directly. The old .doc format is a binary format that this converter can’t read. Open the file in Word, Google Docs or LibreOffice, save it as .docx, and open that here. The same goes for .odt, .rtf and .pages files.
What does “Keep inline styles” do?
It’s off by default, so you get plain semantic HTML with no style attributes at all, which is what most websites and CMSs want. Turn it on to keep text alignment (text-align: center) and text colors. Word’s own styles like mso-bidi-font-size, margins and fonts are never kept either way.
Can I edit the text before I copy the HTML?
Yes. The left panel is a normal editor with a toolbar: headings, bold, italic, lists, links, quotes, text color and table tools (add or delete rows and columns, merge cells, header row). The HTML on the right updates as you type, and the Preview tab shows how it looks in a browser.
Is my document uploaded anywhere?
No. Pasting, cleaning and opening .docx files all happen in your browser, and nothing is sent to a server. The document is kept in this browser’s local storage so it’s still there after a refresh (very big documents with lots of images may not fit). Click the Clear button to remove it.