In shortPaste the HTML, tick what to remove (inline styles, classes, spans, empty tags, Word junk and more) and the cleaned code appears instantly with a preview. The cleaner edits the document tree, so it never breaks nesting.
How to use the HTML cleaner
- Paste the HTML. Paste the messy code or open a file. A sample is loaded to show what the cleaner does.
- Tick what to remove. Sensible defaults are on: Word junk, comments, inline styles, spans, empty tags, , extra spaces, invisible characters and scripts.
- Check the preview. Switch to Preview to see the cleaned content rendered.
- Copy the clean code. Copy it or download clean.html.
Why HTML gets dirty
Copying from Word, Google Docs, websites, email clients or AI chat tools brings along hidden baggage: style attributes on every paragraph, nested <span>s, MsoNormal classes, <o:p> tags, empty paragraphs and invisible Unicode characters. Pasted into a CMS or email template, this junk fights your stylesheet and bloats the page.
What each option removes
| Option | Removes |
|---|---|
| Word / Google Docs junk | mso-* and Mso* classes, <o:p>, <w:…>, conditional comments, docs-internal-guid wrappers, generator meta tags |
| Comments | <!-- … --> |
| Inline styles | Every style="…" attribute (and <style> blocks in fragments) |
| Classes and IDs | class and id attributes |
| All other attributes | Everything except href, src, alt, colspan, rowspan |
| Span and font tags | The tags, keeping their text |
| Empty tags | Elements with no text or media — repeated until none are left |
| / successive spaces | Non-breaking spaces and runs of spaces |
| Invisible / AI watermark characters | Zero-width spaces and joiners, BOM, soft hyphens, bidi marks, narrow no-break spaces |
| Scripts and handlers | <script>, <iframe>, <object>, onclick-style attributes, javascript: links |
| Images / links / tables / all tags | Media, link wrappers, table structure, or everything except text |
What are "AI watermark" characters?
Text copied from some AI tools, PDFs and websites can contain invisible Unicode characters — zero-width spaces (U+200B), zero-width joiners, narrow no-break spaces (U+202F) and similar. They're invisible but break search, word counts and spacing, and some detectors look for them. The cleaner removes them all.
Why it's safer than regex cleaners
Many cleaners use find-and-replace on the raw text, which can leave half-deleted tags. This one parses the HTML into a real document tree (the same way your browser does), edits the elements, and writes it back out — so the result is always well-formed. If you're starting from a Word document, the Word to HTML converter lets you paste the formatted text directly.
Private by design: this tool runs entirely in your browser. Nothing you paste or open is uploaded to a server.
Frequently asked questions
How do I remove inline styles from HTML?
Paste the HTML here with "Remove inline styles" ticked (it's on by default). Every style="…" attribute is removed and the clean code appears on the right.
How do I remove all HTML tags and keep the text?
Tick "Remove ALL tags". For nicer plain text with line breaks and bullet points, use HTML to text.
Can it clean HTML from Microsoft Word?
Yes — "Remove Word / Google Docs junk" handles mso classes, o:p tags and conditional comments. Or paste the document itself into the Word to HTML converter.
Will it remove my links and images?
Not unless you tick those options. By default links, images and tables are kept.
Is it safe for HTML with scripts?
Yes. The preview has scripts disabled, and "Remove scripts" strips them from the output.