Comparison
bleach vs clear-html vs html-sanitizer vs lxml-html-clean
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-sanitizerHTML cleaner from lxml project
Maintained. Last release 6 days ago, commits in 2 of the last 26 weeks. Weaker on commit activity.
$
pip install lxml-html-cleanIn short
- bleach is archived: avoid it for new projects.
- lxml-html-clean is the most used: 22.9M downloads a month.
- Maintenance is comparable: lxml-html-clean 62, html-sanitizer 54, clear-html 41 on Pythie’s Index.
- clear-html is growing fastest: downloads +792% over the last month.
- Safe default for a new project: lxml-html-clean.
Side by side
| Metric | bleach | clear-html | html-sanitizer | lxml-html-clean |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 9 | Pythie’s Index: 41 | Pythie’s Index: 54 | Pythie’s Index: 62 |
| Verdict | Archived | Maintained | Maintained | Maintained |
| Downloads / month | 74.6M | 179.3K | 607K | 22.9M |
| Downloads, month over month | +7% | +792% | +18% | +14% |
| GitHub stars | 2.8K | 17 | 157 | 14 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 416 | 2 | 21 | 220 |
| Last release | Jun 5, 2026 | Oct 24, 2025 | Nov 26, 2026 | Nov 26, 2026 |
| Releases, 12 months | 1 | 0 | 2 | 4 |
| Weeks with commits | 1 / 26 | 4 / 26 | 4 / 26 | 2 / 26 |
| Recent contributors | 2 | 5 | 7 | 13 |
| First release | Feb 2010 | Aug 2023 | May 2017 | Feb 2024 |
| Python versions | 3.10 – 3.14 | 3.9 – 3.14 | 3.10 – 3.15 | 3.8 – 3.15 |
| License | non-standard | MIT | BSD-3-Clause | BSD-3-Clause |
| 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.