HTML Source Cleaner

Clean HTML source by removing classes, scripts and styles while keeping the semantic markup intact, entirely in your browser.

How useful is this tool?

The result will appear here …

How to use this tool (video)

This video is hosted on YouTube. When you play it, data may be sent to Google.

HTML Source Cleaner

The HTML Source Cleaner cleans up your HTML source and reduces it to the semantic core. It removes classes, IDs, inline styles, scripts, stylesheets and event handlers. What remains are the structural elements such as headings (h1 to h6), paragraphs (p), containers (div, span), lists (ul, ol, li) and tables.

What the cleaner removes

  • Classes (class), IDs (id) and inline styles (style)
  • Scripts (script), stylesheets (style, link) and meta tags (meta, noscript)
  • Event handlers (onclick, onload and other on-... attributes)
  • data-... and aria-... attributes as well as embedded media (iframe, canvas, svg)

CSS-aware removal: If you enable the option, the tool additionally removes every element that would be hidden via display: none or visibility: hidden. It recognises these rules in embedded style blocks, in inline styles and via the hidden attribute. So you get only the content that would actually be visible.

What is this useful for?

When migrating a website, building email templates, or preparing third-party HTML snippets, the cleaner helps you get to the bare markup quickly. You can copy the result directly or download it as a .html file.

Frequently asked questions

What does "CSS-aware" mean?

CSS-aware means the tool evaluates embedded style blocks, inline styles and the hidden attribute, and removes every element that would not be visible (for example via display: none or visibility: hidden). External stylesheets cannot be loaded and evaluated for privacy reasons.

Why are external stylesheets not considered?

Processing runs entirely in your browser. To avoid calling external URLs and to keep your data local, the tool only evaluates embedded styles and inline styles.

Which attributes are kept?

Semantically relevant attributes such as href, src, alt, title, colspan and rowspan are kept. Styling and behaviour attributes (class, id, style, on-...-, data-...-, aria-...-) are removed.

Frequently asked questions

Are my contents uploaded anywhere?

No. Cleaning runs entirely in your browser. Your HTML code is not transmitted to our server or stored.