All free tools

Clean Word HTML

Strip the Office markup out of HTML pasted from Word, and keep the structure that matters.

Everything runs in your browser. Nothing you paste is uploaded.

What this does

Paste HTML that came out of Word, or out of an editor that took a Word paste, and it comes back without the Office markup. Headings, lists, tables, links and emphasis are kept. Everything describing how Word drew the page is removed.

There is no file upload and no library. Your browser already contains a complete HTML parser, and that is what does the work.

How to use it

  1. Copy the HTML you want to clean. Paste it into the box above.
  2. Leave Also strip inline styles ticked unless you have a reason not to.
  3. The cleaned version appears underneath as you type.
  4. Press Copy, and paste it wherever it needs to go.

Why Word HTML is like this

Word was built to describe a printed page, and its HTML export carries that history. When you copy from Word, the clipboard holds a full HTML document intended to be reopened by Word, complete with the information needed to reconstruct the layout exactly.

Most of that is useless anywhere else:

  • mso- properties. Hundreds of style declarations such as mso-pagination and mso-fareast-font-family. No browser understands any of them, so they do nothing except make the file larger.
  • Office namespace tags.Elements like o:p and v:shape belong to Word’s own XML vocabulary. Browsers do not recognise them and render them as empty inline elements.
  • Mso class names. MsoNormal, MsoListParagraph and their relatives point at a stylesheet that only exists inside Word.
  • Conditional comments. Blocks wrapped in an instruction for Internet Explorer, holding Word settings. They have not done anything for over a decade.
  • Empty spans and paragraphs. Word uses these for spacing. Once the styles are gone they hold nothing at all.

On a real document this is often most of the file. It is not unusual for cleaning to remove two thirds of the markup without touching a single word of the text.

Inline styles, and why they are the real problem

The markup that actually breaks your page is not the Office tags, which browsers quietly ignore. It is the inline styles, which browsers obey.

Word writes font families, sizes, colours and margins directly onto elements. An inline style beats anything in your theme stylesheet, so pasted content keeps Word’s 11 point Calibri while the rest of your site uses your chosen font. The paste looks fine in the editor and wrong on the page, and no amount of theme customisation fixes it, because the problem is attached to the content rather than the design.

That is why stripping them is the default. If you turn the option off, the Office properties are still removed and the rest are kept, which is occasionally what you want when a table has deliberate column widths.

When to use something else

This tool cleans markup you already have. If you still have the original .docx file, you will get a better result by converting that instead, because the structure is intact in the file and has not yet been flattened by a trip through the clipboard.

Use our DOCX to Gutenberg tool for that. It reads the file directly and produces block markup rather than cleaned HTML.

And if the same cleaning happens every week, the honest answer is that neither browser tool is the right shape for the job. Both handle one thing at a time. The plugin runs inside WordPress and handles the whole pipeline, including the parts a browser tab cannot reach.

Where Word HTML comes from

This markup reaches people by several routes, and the mess is the same in each:

  • Copying from Word and pasting into an editor. The clipboard carries a full HTML document, and most editors keep it.
  • Save as Web Page from Word. The most extreme version. Word writes an entire stylesheet plus its own XML settings block.
  • Outlook email bodies. Outlook composes in the same engine, so email HTML carries the same properties.
  • Content already sitting in a CMS. Often the worst case, because it was pasted years ago and nobody noticed.

That last one is worth checking if your site has posts that never look quite right. View the source of one and look for mso- or MsoNormal. It is very common on sites that have been running for a while.

What cleaning cannot fix

Cleaning removes what should not be there. It cannot add back what was never there in the first place, and the difference matters.

If a heading was bold text in Word, it arrives as a bold paragraph and leaves as a bold paragraph. Nothing in the markup says it was meant to be a heading, so nothing can promote it to one. The same goes for lists made by typing dashes at the start of lines: they are paragraphs that begin with a dash, and they stay that way.

This is why converting the original file beats cleaning a paste. The .docx still knows which paragraphs are headings and which are list items. Once it has been through the clipboard, some of that is gone for good.

Checking the result

After cleaning, it is worth a quick look at what came back:

  1. Are the headings still h2 and h3 elements? If the whole document is paragraphs, the headings were never real.
  2. Are the lists ul and ol elements, or paragraphs that look like lists?
  3. Do the tables still have a thead? Word only writes one if the header row was marked as repeating.
  4. Are the links intact, with their href attributes?

If the answer to the first two is no, cleaning has done its job and the document still has a structural problem. That is a document problem rather than a markup one, and our Word heading checker will tell you how widespread it is.

Safe to paste anywhere

The output is plain HTML with no scripts and no external references. It is safe to paste into the WordPress code editor, a Custom HTML block, a static site generator, or an email template.

One caution: images. If the original markup referenced images by URL, those URLs are kept exactly as they were. If they pointed at a local file path on the machine Word was running on, they will be broken wherever you paste this, and no cleaner can fix that because the file was never anywhere a browser could reach.

Common questions

Microsoft Office style properties beginning mso-, Office namespace tags such as o:p and v:shape, class names starting Mso, conditional comments meant for old versions of Internet Explorer, font tags, empty spans, and empty paragraphs. Optionally all inline styles as well.

Everything that carries meaning. Headings, paragraphs, ordered and unordered lists, tables, links, bold, italic and images all survive. The aim is to remove the description of how Word drew the page while keeping what the page says.

Usually yes, which is why it is on by default. Word inline styles are the most common reason pasted content looks wrong in a theme, since they override your site fonts and colours. Turn it off if you deliberately want to keep specific colours or alignment.

No. The cleaning runs in your browser using its own HTML parser. Nothing is uploaded, stored or logged.

Because HTML with nested tags and attributes containing angle brackets breaks pattern matching quickly, and Word produces plenty of both. This tool parses the HTML properly and walks the resulting tree, which is what your browser already does when it renders a page.

It fixes pasted markup. If you have the original .docx file, converting it directly gives a better result than cleaning up a paste, because the structure is still intact in the file. Our DOCX to Gutenberg tool does that.

Related Articles

Done. Copy the cleaned HTML above.

Doing this often?

This tool handles one document and gives you markup to paste. The DocxToWP plugin skips the copy and paste. It uploads your images to the Media Library as real attachments, fills your Yoast or Rank Math fields, and imports a hundred documents in one run.

The free plugin has no upload cap. Pro is $39 one-time and adds bulk import, scheduling and SEO fields.

Get Pro for $39