Skip to content

HTML cleaner for content pasted from Word, Docs and the web.

Paste content from Word, Google Docs or any website and get clean, semantic HTML without inline styles, classes or junk.

Keep
Clean
Indent
Paste as
No content yet.
Show

Clean HTML appears here

Inline styles, classes, fonts, spans and Office markup are removed. Headings, lists, links, tables and images stay.

Free and private: this tool runs entirely in your browser.Need a fast website or web app? Talk to TechnoHelp

How to use the HTML cleaner

  1. Paste your content

    Copy text from Word, Google Docs or a web page, click the box and paste. Formatted paste captures the HTML behind it. Switch to HTML code to paste source code instead, or open an .html file.

  2. Choose what to keep

    Headings, bold and italic, links, images and tables are kept by default. Turn any of them off for plainer output, and choose 2 spaces, 4 spaces or minified HTML.

  3. Check the result

    The preview shows how the clean content will look. Switch to HTML or Text to see the code or plain text, and see how many styles, classes and bytes were removed.

  4. Copy it into your editor

    Use Copy HTML for code or HTML views, Copy rich text to paste formatted content into a visual editor, or download a clean .html file.

What gets removed, and what stays.

Removed

  • Inline style attributes (fonts, colors, sizes, spacing)
  • class and id attributes, data-* and other attributes
  • <span> and <font> wrappers that only carried styling
  • Microsoft Office markup: mso- styles, <o:p>, smart tags and conditional comments
  • Scripts, style blocks, forms, iframes and event handlers
  • Empty paragraphs, stray line breaks and (optionally) non-breaking spaces
  • javascript: links and in-page anchors that would break
  • Images that point to temporary files on your computer

Kept

  • Headings (h1–h6), paragraphs and line breaks
  • Bold, italic, underline, strikethrough, subscript and superscript
  • Links, with only their address and title
  • Bullet and numbered lists, including Word lists rebuilt as real lists
  • Tables, with merged cells (colspan and rowspan)
  • Images from the web, with src, alt, width and height
  • Quotes, code blocks and horizontal rules

Why pasted content carries so much code.

When you copy formatted text, your clipboard also holds an HTML version of it, with every font, color and margin written into the markup.

Word adds its own Office markup and turns bullet points into styled paragraphs with a bullet character. Google Docs wraps the whole selection in a bold tag set to normal weight and expresses bold and italic as inline styles. Web pages bring their class names, layout wrappers and sometimes scripts.

Pasted into a website, that code overrides your site’s design, so fonts and sizes stop matching. It makes pages heavier, and fake lists and headings are harder for screen readers and search engines to understand. Clean, semantic HTML lets your stylesheet do the styling.

Pasting into your editor.

WordPress (block editor)
Add a Custom HTML block, or switch to the Code editor, and paste the HTML. Or paste rich text into a paragraph block.
WordPress (classic editor)
Paste the HTML into the Text tab, or rich text into the Visual tab.
Shopify
In the rich text editor, click Show HTML (the <> button) and paste the HTML.
Ghost
Insert an HTML card and paste the HTML.
Any rich text editor
Use Copy rich text and paste normally. The formatting stays, the clutter doesn't.

Frequently asked questions.

How do I remove inline styles from HTML?

Paste your HTML or formatted content into the HTML cleaner. It removes every style attribute, along with classes and styling wrappers like span and font, while keeping headings, lists, links, tables and images. Copy the clean HTML when you're done.

How do I clean up HTML copied from Microsoft Word?

Copy the text in Word, paste it into the cleaner with Formatted paste selected, and copy the result. Word's Office markup, mso- styles and empty paragraphs are removed, and Word's bullet and numbered paragraphs are rebuilt as real HTML lists.

Why is content pasted from Google Docs wrapped in a bold tag?

Google Docs wraps copied content in a <b> tag with font-weight set to normal, and marks real bold and italic text with inline styles. The cleaner removes that wrapper and turns styled bold and italic text into proper <strong> and <em> tags.

What is the difference between Copy HTML and Copy rich text?

Copy HTML copies the clean source code, for HTML views, code editors and templates. Copy rich text copies the formatted content itself, so you can paste it straight into a visual editor and keep headings, bold text and lists without the clutter.

Is my content uploaded anywhere?

No. The cleaner runs entirely in your browser. What you paste or open is processed on your device and is never sent to a server.

Can it handle large documents?

Yes. Long documents with thousands of paragraphs are cleaned in your browser, and the page stays responsive while it works. You can also open HTML files of up to 20 MB.

Why were some images removed?

When you copy from Word, images often point to temporary files on your computer (file:// addresses) that won't work on a website, so the cleaner removes them and tells you how many. Upload those images to your editor separately. Images from the web are kept.

Is the cleaned HTML safe to publish?

The cleaner removes scripts, event handlers and javascript: links, and keeps only an allowlist of tags and attributes, so the output is plain content markup. If your website accepts HTML from untrusted visitors, you should still sanitize it on the server.

From the team behind these tools

Want a website that's easy to keep up to date?

TechnoHelp is an independent web design and development studio. We build fast, secure and scalable websites and web apps on a modern stack, with editors your team will enjoy using.

More free tools.

See all tools