HTML DOM Sanitizer

Strip scripts, styles, and noisy attributes from messy webpage HTML — or export clean text / Markdown with DOMPurify.

100% In-Browser & Private — your data never leaves this device
Loading tool...

How to use the HTML DOM Sanitizer

  1. Paste messy HTML from a page or email.
  2. Choose Clean HTML, Strip attributes, Text only, or Markdown.
  3. In Strip attributes, optionally keep href/src/alt/title or remove every attribute.
  4. Copy or download the cleaned output — DOMPurify never leaves your browser.

FAQ

What does Clean HTML do?
DOMPurify removes dangerous tags (script, style, iframe, etc.) and event-handler attributes while keeping safe structure.
What does Strip attributes do?
After sanitizing, tags remain but attributes are removed. Keep href/src/alt/title to preserve links and images, or strip all attributes for structure-only markup.
What do Text only and Markdown do?
Text only extracts visible text. Markdown converts common blocks (headings, lists, links, code) into a lightweight Markdown approximation.
Is my HTML uploaded?
No. Sanitization runs with DOMPurify in your browser.

Related tools

More private, in-browser utilities you might need next.

Looking for more? Browse all developer tools · All tools