Top JavaScript HTML Sanitizers 2025

GitHub Libraries JavaScript HTML Sanitizers

cure53/dompurify 14K +74

Added by sizovs added 3 weeks 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 +14

Added by sizovs added 3 weeks 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.