Word / Google Docs to Clean HTML
This free tool converts content copied from Microsoft Word or Google Docs into clean, semantic HTML. Paste your document, and the cleaner strips out MSO classes, Word-only tags, inline styles, endless nested spans, and empty paragraphs, then rebuilds proper headings, paragraphs, bold and italic tags, links, tables, and real bulleted and numbered lists. Get HTML that's ready to drop into WordPress or any CMS, with no signup and nothing uploaded to a server.
What Was Cleaned
What Does the Word to HTML Cleaner Remove?
Everything that controls how the text looked in Word or Google Docs, and nothing that controls what it means. The cleaner removes:
- MSO classes and styles like
class="MsoNormal",mso-list,mso-bidi-font-weight, andmso-spacerun. - Word-only tags like
<o:p>, VML shapes, embedded XML, and conditional comments such as<!--[if gte mso 9]>. - Inline styles for fonts, sizes, colors, line heights, margins, and backgrounds.
- Spans and font tags, including the one-span-per-word soup Google Docs produces.
- Empty tags like
<p> </p>spacer paragraphs and stray<br>tags between blocks. - Junk attributes like
lang,dir,align,width,valign, Google Docs heading IDs, and Word bookmarks. - Hidden text, comments, invisible zero-width characters, and soft hyphens.
What's left is the structure: headings, paragraphs, bold and italic text, links, lists, tables, block quotes, superscript, subscript, and images. If your text still has stray invisible characters or curly quotes you want to change, run it through our Whitespace / Invisible Character Stripper or Smart Quotes to Straight Quotes Converter.
Why Is HTML From Word and Google Docs So Messy?
Word's HTML is built to be pasted back into Word. When you copy from Word, it puts a version of your document on the clipboard that's designed so another copy of Word can rebuild it perfectly. That means every font, margin, and spacing setting rides along as MSO styles, and even bulleted lists aren't real lists. Each bullet is a paragraph with a fake bullet character tucked inside a hidden span. It's common for a one-page document to produce 30 to 50 KB of HTML for a few kilobytes of actual text.
Google Docs wraps every run of text in its own styled span. Each change in formatting starts a new <span> with a long inline style that spells out the font, size, color, weight, and spacing. The whole paste is wrapped in a bold tag that's styled to not be bold, and links in Docs HTML exports are often routed through Google redirect URLs.
That junk causes real problems when it lands in your CMS:
- It fights your theme. Inline fonts, sizes, and colors override your site's CSS, so pasted posts look slightly off from everything else on the site.
- It bloats your pages. Extra markup adds weight to every page load and makes the HTML harder to edit later.
- It hides your structure. Fake lists and styled spans instead of real tags make it harder for screen readers and search engines to understand your content.
What Is Semantic HTML, and Why Does It Matter?
Semantic HTML uses tags that describe what content is, not just how it looks. A span styled with font-weight:700 looks bold, but a <strong> tag tells browsers, screen readers, and search engines that the text is important. A paragraph with a bullet character looks like a list, but a <ul> with <li> items is a list.
This cleaner converts formatting into meaning wherever it can:
- Bold styling becomes
<strong>, and italic styling becomes<em>. - Word's fake list paragraphs become real, properly nested
<ul>and<ol>lists, with the starting number kept. - Word's Title style becomes an
<h1>, and its Quote styles become<blockquote>. - Superscript and subscript styling becomes
<sup>and<sub>, and strikethrough becomes<s>. - Wrapper
<div>tags are removed or turned into paragraphs.
Real lists, tables, and headings are also easier for Google to understand and pull into featured snippets, and they let your theme style every post consistently.
How Do I Paste the Clean HTML Into WordPress?
There are three easy ways, depending on how you like to work:
- Block editor, fastest: Click Copy Rich Text, then paste into an empty paragraph block. WordPress turns the headings, paragraphs, lists, and tables into separate blocks automatically.
- Block editor, as code: Click Copy HTML, switch to the Code editor (Ctrl+Shift+Alt+M, or Cmd+Shift+Option+M on Mac), and paste.
- Classic editor: Click Copy HTML, switch to the Text tab, and paste.
Since WordPress uses your post title as the page's H1, turn on Shift headings down one level if your document starts with its own H1 or Title. Other platforms like Shopify, Webflow, HubSpot, and Squarespace all have an HTML or source view that accepts the same output.
What Happens to My Images?
From Word: When you copy from the Word desktop app, images are saved as temporary files on your own computer, and the HTML points to those local files (like file:///C:/Users/.../clip_image001.png). Nobody else can load them, so the cleaner removes them and tells you how many were dropped.
From Google Docs: Images point to Google-hosted URLs that are tied to your document and aren't meant for permanent public use, so they can stop working later. The cleaner keeps them so you can see where they go, and flags them so you remember to swap them out.
Either way, the right move is the same: download your images, upload them to your own media library, and add descriptive alt text. The cleaner also points out any images that are missing alt text.
Why Did My Fonts, Colors, and Alignment Disappear?
On purpose. Fonts, font sizes, colors, highlight colors, alignment, and spacing are presentation, and on a website, presentation belongs to your theme's stylesheet. When those settings come along as inline styles, they override your theme and make pasted posts look subtly different from the rest of your site.
If a passage genuinely needs special treatment, like a centered call-out or a colored note, add it with your CMS's block settings or a CSS class after pasting. That way it stays consistent with your design and is easy to change site-wide later. And if you want to shrink the HTML even further for a static page or email, run the result through our HTML Minifier.
Is My Document Uploaded Anywhere?
No. The entire conversion runs in your browser. Your document is never sent to our server or anyone else's, nothing is saved, and there's no signup. Close the tab and it's gone.
The tool is also built to be safe with untrusted HTML. Pasted content is processed in an isolated document where scripts can't run, only a strict list of tags and attributes makes it into the output, and links using dangerous schemes like javascript: are removed. The preview is shown in a sandboxed frame with scripts disabled.
Related Tools
Let's Grow Your Business
Want some free consulting? Let's hop on a call and talk about what we can do to help.
