Skip to content
JS
Package

sanitize-html

Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis

v2.17.7, 13 Aug 2026MITCommonJSTypes: NoneSecurity
$ npm install sanitize-html

Key numbers

As of 25 Sept 2026
Weekly downloads
7.9m
+133% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
7
Direct, from package.json
Last release
1 month ago
v2.17.7
GitHub stars
4.6k
653 forks
Open issues / PRs
121 / 21
Contributors
-
Commits, last 52 weeks
336

Downloads

Last week 2026-09-15 to 2026-09-21
05m10m15mSept 2025Mar 2026Sept 2026High 12.4m (28 Jul 2026)Low 1.9m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

7,871,463 downloads last week, 35,647,913 in the last month. The 12-month change of +133% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
7121 in total
Latest version
2.17.7, 13 Aug 20261 month ago
First published
10 Sept 2013
Last push to GitHub
24 Sept 2026same day as the snapshot
Repository archived
No
Open issues
121
Open pull requests
21
Commits, last 52 weeks
336
Dependents on npm
2,645

Major versions

  1. v2 first release 2.0.0, 23 Sept 2020
  2. v1 first release 1.0.0, 5 Jan 2014
  3. v0 first release 0.1.0, 10 Sept 2013

Recent releases

VersionPublished
2.17.713 Aug 2026
2.17.610 Jul 2026
2.17.510 Jun 2026
2.17.413 May 2026
2.17.315 Apr 2026
2.17.218 Mar 2026
2.17.118 Feb 2026
2.17.014 May 2025
2.16.016 Apr 2025
2.15.019 Mar 2025
2.14.018 Dec 2024
2.13.13 Oct 2024
2.13.020 Mar 2024
2.12.122 Feb 2024
Module format
CommonJSFrom package.json type, main and exports fields
TypeScript types
None
Node.js engine range
>=22.12.0
Runtimes
-
Unpacked size (npm)
74 kB
Dependencies (7)
launderpostcssdeepmergehtmlparser2parse-srcsetis-plain-objectescape-string-regexp
npm install sanitize-html

CDN

jsDelivr: 195.8k requests in 30 days
  • jsDelivrhttps://cdn.jsdelivr.net/npm/sanitize-html@2.17.7/
  • unpkghttps://unpkg.com/sanitize-html@2.17.7/
  • esm.shhttps://esm.sh/sanitize-html@2.17.7
Sources: npm registry, npm downloads API, GitHub API, jsDelivr. Data fetched 25 Sept 2026.

Indexability: Indexed.