Skip to main content

HTML Sanitizer

Sanitize HTML to prevent XSS attacks

How to Use HTML Sanitizer

  1. Paste the HTML you want to clean.
  2. Choose a mode: Strict for text formatting only, Basic to allow links and common markup, Permissive to strip only scripts and event handlers.
  3. Review the threat counter and the cleaned output.
  4. Copy the sanitised HTML.

About HTML Sanitizer

What this page solves

Rendering user-submitted HTML — from a comment box, WYSIWYG editor, or Markdown import — without sanitizing is the top source of XSS on the web. This tool strips dangerous tags, attributes, and URLs client-side so you can preview exactly what your app will render.

HTML Sanitizer strips XSS-dangerous tags (`