Comparison
bleach vs clear-html vs html-sanitizer vs nh3
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
An easy safelist-based HTML-sanitizing tool.
Archived. The repository is read-only: no more fixes or releases will come.
pip install bleachClean and normalize HTML.
Maintained. Last release 13 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install clear-htmlHTML sanitizer
Maintained. Last release 6 days ago, commits in 4 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install html-sanitizerPython binding to Ammonia HTML sanitizer Rust crate
Actively maintained. Last release 2 weeks ago, commits in 12 of the last 26 weeks. A safe choice.
pip install nh3In short
- bleach is archived: avoid it for new projects.
- nh3 is the most used: 45.8M downloads a month.
- nh3 also has the best Pythie’s Index (87).
- clear-html is growing fastest: downloads +792% over the last month.
- Safe default for a new project: nh3.
Side by side
| Metric | bleach | clear-html | html-sanitizer | nh3 |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 9 | Pythie’s Index: 41 | Pythie’s Index: 54 | Pythie’s Index: 87 |
| Verdict | Archived | Maintained | Maintained | Actively maintained |
| Downloads / month | 74.6M | 179.3K | 607K | 45.8M |
| Downloads, month over month | +7% | +792% | +18% | +16% |
| GitHub stars | 2.8K | 17 | 157 | 411 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 416 | 2 | 21 | 262 |
| Last release | Jun 5, 2026 | Oct 24, 2025 | Nov 26, 2026 | Nov 17, 2026 |
| Releases, 12 months | 1 | 0 | 2 | 6 |
| Weeks with commits | 1 / 26 | 4 / 26 | 4 / 26 | 12 / 26 |
| Recent contributors | 2 | 5 | 7 | 10 |
| First release | Feb 2010 | Aug 2023 | May 2017 | Aug 2021 |
| Python versions | 3.10 – 3.14 | 3.9 – 3.14 | 3.10 – 3.15 | – |
| License | non-standard | MIT | BSD-3-Clause | MIT |
| Known vulnerabilities | None | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.