# Symfony HtmlSanitizer

PHP component with an object-oriented API for sanitizing untrusted HTML input before it is inserted into a document.


Source: https://findsoftware.frbit.cloud/symfony-html-sanitizer/
Last reviewed: 2026-11-16
Listed since: 2026-11-16

## Record

### Links

- home: https://symfony.com/packages/html-sanitizer
- repository: https://github.com/symfony/html-sanitizer
- docs: https://symfony.com/doc/current/html_sanitizer.html

### Identity

- status: active
- maintainer: Fabien Potencier
- maintainerType: unknown
- parent: unknown
- firstRelease: 2022
- hqCountry: unknown

### Kind

- category: library
- hosting: php
- language: php
- runtime: php
- runtimeMin: php 8.4
- 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: MIT

### Releases

- currentMajor: 8
- latestReleaseDate: 2026-11-04

### Adoption

- githubStargazers: 285
- packagistDownloads: 71420224
- npmWeeklyDownloads: not applicable
- contributors: 25
- pluginCount: unknown
- packagistMonthlyDownloads: 9744662
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 1150
- dependentPackages: 29

### Sources

- urls: https://symfony.com/packages/html-sanitizer (read 2026-11-16)
- urls: https://api.github.com/repos/symfony/html-sanitizer (read 2026-11-16)
- urls: https://symfony.com/doc/current/html_sanitizer.html (read 2026-11-16)
- category: https://symfony.com/packages/html-sanitizer (read 2026-11-16)
- language: https://api.github.com/repos/symfony/html-sanitizer (read 2026-11-16)
- runtime: https://github.com/symfony/html-sanitizer/blob/v8.1.11/composer.json (read 2026-11-16)
- runtimeMin: https://github.com/symfony/html-sanitizer/blob/v8.1.11/composer.json (read 2026-11-16)
- license: https://api.github.com/repos/symfony/html-sanitizer (read 2026-11-16)
- maintainer: https://github.com/symfony/html-sanitizer/blob/8.2/LICENSE (read 2026-11-16)
- firstRelease: https://repo.packagist.org/p2/symfony/html-sanitizer.json (read 2026-11-16)
- currentMajor: https://github.com/symfony/html-sanitizer/releases (read 2026-11-16)
- latestReleaseDate: https://api.github.com/repos/symfony/html-sanitizer/releases (read 2026-11-16)
- installMethod: https://symfony.com/doc/current/html_sanitizer.html (read 2026-11-16)
- packagistDownloads: https://packagist.org/packages/symfony/html-sanitizer.json (read 2026-11-16)
- packagistMonthlyDownloads: https://packagist.org/packages/symfony/html-sanitizer.json (read 2026-11-16)
- githubStargazers: https://api.github.com/repos/symfony/html-sanitizer (read 2026-11-16)
- contributors: https://api.github.com/repos/symfony/html-sanitizer/contributors (read 2026-11-16)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/symfony/html-sanitizer (read 2026-11-16)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/symfony/html-sanitizer (read 2026-11-16)

## Notes

Symfony HtmlSanitizer is a PHP component that cleans untrusted HTML before it is inserted into a document. It rebuilds the markup from the elements and attributes a configuration allows, and its docs give output from WYSIWYG editors as an example of untrusted input. It is based on the W3C HTML Sanitizer standard proposal.

The Symfony framework exposes the sanitizer as a service. It integrates with Symfony Forms through an option on text fields, and the docs show a Twig filter and a standalone use.

The repository is a read-only split of the main Symfony repository, which takes the issues and pull requests.

---

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
