# HTML Purifier

HTML filter library written in PHP that removes XSS attacks and makes the output standards-compliant HTML.


Source: https://findsoftware.frbit.cloud/htmlpurifier/
Last reviewed: 2026-11-09
Listed since: 2026-11-09

## Record

### Links

- repository: https://github.com/ezyang/htmlpurifier
- docs: https://github.com/ezyang/htmlpurifier/tree/master/docs

### Identity

- status: active
- maintainer: Edward Z. Yang
- maintainerType: individual
- parent: unknown
- firstRelease: 2006
- hqCountry: unknown

### Kind

- category: library
- hosting: php
- language: php
- runtime: php
- runtimeMin: php 5.6
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: not applicable
- renderingModes: not applicable
- installMethod: composer

### License

- licenseModel: open-source
- license: LGPL-2.1

### Releases

- currentMajor: 4
- latestReleaseDate: 2026-09-15

### Adoption

- githubStargazers: 3349
- packagistDownloads: 398363604
- npmWeeklyDownloads: not applicable
- contributors: 95
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 36567
- dependentPackages: 417

### Sources

- urls: https://api.github.com/repos/ezyang/htmlpurifier (read 2026-11-09)
- urls: https://github.com/ezyang/htmlpurifier/blob/master/README.md (read 2026-11-09)
- maintainer: https://github.com/ezyang/htmlpurifier/blob/v4.19.1/composer.json (read 2026-11-09)
- language: https://api.github.com/repos/ezyang/htmlpurifier (read 2026-11-09)
- category: https://github.com/ezyang/htmlpurifier/blob/master/README.md (read 2026-11-09)
- runtime: https://github.com/ezyang/htmlpurifier/blob/v4.19.1/composer.json (read 2026-11-09)
- runtimeMin: https://github.com/ezyang/htmlpurifier/blob/v4.19.1/composer.json (read 2026-11-09)
- installMethod: https://github.com/ezyang/htmlpurifier/blob/master/README.md (read 2026-11-09)
- packagistDownloads: https://packagist.org/packages/ezyang/htmlpurifier.json (read 2026-11-09)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/ezyang%2Fhtmlpurifier (read 2026-11-09)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/ezyang%2Fhtmlpurifier (read 2026-11-09)
- firstRelease: https://api.github.com/repos/ezyang/htmlpurifier/git/commits/725a8cb4a4a9d0788c54c60097c6d097d6cb29af (read 2026-11-09)
- license: https://api.github.com/repos/ezyang/htmlpurifier (read 2026-11-09)
- licenseModel: https://raw.githubusercontent.com/ezyang/htmlpurifier/master/LICENSE (read 2026-11-09)
- currentMajor: https://api.github.com/repos/ezyang/htmlpurifier/releases (read 2026-11-09)
- latestReleaseDate: https://api.github.com/repos/ezyang/htmlpurifier/releases (read 2026-11-09)
- githubStargazers: https://api.github.com/repos/ezyang/htmlpurifier (read 2026-11-09)
- contributors: https://api.github.com/repos/ezyang/htmlpurifier/contributors?per_page=1 (read 2026-11-09)

## Notes

HTML Purifier is an HTML filter library written in PHP. It splits a document into tokens, removes elements and attributes that are not on its whitelist, and checks nesting and well-formedness, so the output is standards-compliant HTML. The author named in the package manifest is Edward Z. Yang.

## Worth knowing

The project's own site says the library "is not perfect; it can interact poorly with existing JavaScript on websites".

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
