</>

HTML Cleanup Tool

— strip formatting noise, keep what matters
🌙Theme
⚙ Cleanup Rules
Preset:
Attributes ▼
Tags ▼
Encoding & Invisible Characters ▼
MS Office & CMS Artifacts ▼
Whitespace ▼
Input
0 characters
Output
0 characters
Changes Applied
Run cleanup to see what was changed.

What this tool does

HTML Cleanup Tool strips formatting noise from HTML without touching your actual content. It's built for situations where you're copying HTML from one platform to another — like migrating articles between a CMS, pasting from a rich text editor, or cleaning up content copied from Word or Google Docs — and the destination ends up with a mess of inline styles, junk attributes, and invisible characters that weren't supposed to come along.

Paste your messy HTML into the Input box, choose a preset or configure individual rules, hit Run Cleanup, and copy the cleaned result.

What it never touches

No matter which preset or rules you have enabled, the following are always preserved:

  • All text content — words, sentences, paragraphs
  • Links — all <a> tags and their href values stay intact
  • Images — <img> tags and their src attributes are never removed
  • Document structure — headings, paragraphs, lists, tables and their data
  • Semantic formatting — bold, italic, underline tags (<strong>, <em>, etc.)
  • Anchor IDs — id attributes on <a> tags are preserved even when id removal is enabled, since they may be link targets
This is not scorched earth. Unlike pasting into Notepad — which strips everything down to raw text with no tags at all — this tool keeps your document structure completely intact. Think of it as the difference between a cluttered Word doc and a clean one: same content, same layout, just without all the formatting noise layered on top.

Presets explained

  • Safe — The recommended general-purpose starting point. Removes common junk, including HTML comments, without deliberately removing document-level structural wrappers.
  • WordPress — Safe cleanup plus bare <div> wrappers and outer <main>, <article>, <header> and <footer> tags. Their inner content is preserved. Designed for HTML that will be pasted inside a WordPress post or page.
  • Aggressive — All rules enabled, including aria-* attributes. Best for heavily polluted HTML where you want the most complete cleanup. Review the output before using it.
  • Clear All — Unchecks everything so you can hand-pick exactly which rules to run.

Rule categories

  • Attributes — Removes formatting and metadata attributes that editors inject but serve no purpose in the destination. Includes inline styles, class names, data-* tracking attributes, lang= on inline elements, and old HTML4 presentational attributes like align= and bgcolor=.
  • Tags — Cleans up tag-level clutter: empty paragraphs, bare spans, legacy <font> and <center> elements, duplicate <br> tags, redundant nested formatting, bare <div> wrappers, and optional WordPress structural wrappers (<main>, <article>, <header>, <footer>). Wrapper cleanup always keeps the content inside.
  • Encoding & Invisible Characters — Targets characters you can't see but that cause problems: zero-width spaces, soft hyphens, non-breaking hyphens from Word's autocorrect, and curly/smart quotes.
  • MS Office & CMS Artifacts — Specifically targets markup that comes from copying out of Word, Outlook, or certain CMS editors: <o:p> tags, mso-* style values, conditional comment blocks, and xmlns namespace declarations.
  • Whitespace — Collapses excessive blank lines and trims trailing spaces from each line.

Tips

  • The Changes Applied bar at the bottom of the tool shows exactly which rules fired, so you can always see what was modified.
  • If your destination platform uses specific class names to style callout boxes, tables, or code blocks, be careful with the Class attributes rule — those classes would be removed along with the junk ones.
  • The Smart quotes rule converts curly quotes to straight ASCII quotes. If your content intentionally uses typographic quotes (like in published articles), leave this one off.
  • The aria-* rule is only in Aggressive because some aria attributes are intentionally added for accessibility. Only remove them if you know they were injected by an editor rather than added on purpose.
  • You can mix and match rules manually after applying a preset — presets just set a starting point.
  • Use the Light / Dark toggle in the top-right corner of the header to switch themes.