HTML Cleaner
Paste messy or bloated HTML and clean it up in one click. Remove inline styles, Word markup, empty tags, scripts, comments, and unwanted attributes — keeping only the structure you need.
Last updated: May 20, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML Cleaner?
HTML pasted from Microsoft Word, Google Docs, or email clients is notoriously messy — it carries dozens of inline styles, Microsoft Office namespace tags, conditional comments, proprietary classes, and empty spans that make the markup bloated and hard to maintain. CMS editors, email template builders, and front-end developers regularly need to clean up this kind of HTML before it goes into production.
This tool lets you selectively strip exactly what you don't want: inline style attributes, script and style blocks, HTML comments, Word-specific markup (mso-* styles, <o:p> tags, conditional comments), empty elements, and class, id, or data-* attributes. The result is lean, clean HTML that's easy to work with.
How to Use HTML Cleaner
Paste HTML into the input area or click "Load Sample"
Toggle the cleaning options you want to apply
The output updates instantly as you toggle options
Copy the cleaned HTML or download it as an .html file
Check the stats bar to see how much was removed
Common Use Cases
- CMS editors cleaning up HTML pasted from Microsoft Word or Google Docs before publishing.
- Front-end developers stripping inline styles from a designer-supplied HTML prototype before styling with CSS classes.
- Email marketers removing tracking cruft and inline styles from HTML email templates before editing.
- Back-end engineers sanitising user-submitted HTML before storing or rendering it.
- Developers preparing HTML snippets for code reviews by removing noisy auto-generated attributes.
- Teams migrating content between CMS platforms, cleaning vendor-specific markup from exported HTML.
Example Input and Output
HTML pasted from Microsoft Word with mso-* styles, namespace tags, and empty spans is cleaned to readable markup.
<p class="MsoNormal" style="mso-style-unhide:no;mso-style-qformat:yes;margin:0cm">
<span style="font-size:12.0pt;font-family:"Arial";mso-fareast-font-family:Arial">
Hello <strong style="mso-bidi-font-weight:normal">World</strong>
</span>
<o:p></o:p>
</p>
<p class="MsoNormal" style="margin:0cm">
<span style="font-size:12.0pt"> </span>
</p><p>
<span>
Hello <strong>World</strong>
</span>
</p>Privacy
All HTML cleaning runs in your browser. No data is uploaded to any server.
Word paste tip
For HTML copied from Word, enable Remove Inline Styles, Remove Word Markup, Remove Empty Tags, and Remove Comments together — this combination removes the majority of Word bloat in one pass.

