# sanitize-html — card for AI agents

Clean up user-submitted HTML while preserving allowlisted elements and attributes.

Category: Markdown, editors and content · npm package `sanitize-html` · latest version 2.18.1 (checked 2026-11-01)
Install: `npm install sanitize-html`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 64.6 (#702 of all tools, 38 of 149 in its category)
- Used in 37 public projects set up for AI coding agents (0.6%)
- Downloads last week: 18,919,515 (as of 2026-11-24), +54.4% over 4 weeks
- GitHub stars: 4,672 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
Playwright (JavaScript) 67.6%, ESLint 89.2%, Tailwind CSS 81.1%, Zod 67.6%, clsx 54.1%, TypeScript 89.2%

## Links
- AgentGid page: https://agentgid.com/tools/sanitize-html/
- Homepage: https://github.com/apostrophecms/apostrophe/tree/main/packages/sanitize-html#readme
- Repository: https://github.com/apostrophecms/apostrophe

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
