The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

Top JavaScript HTML Sanitizers 2025

GitHub Libraries JavaScript HTML Sanitizers

cure53/dompurify 15K +79

added 2 months ago

DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.

apostrophecms/sanitize-html 3K +11

added 2 months ago

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.