PHPackages                             protonlabs/htmlpurifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. protonlabs/htmlpurifier

Abandoned → [ezyang/htmlpurifier](/?search=ezyang%2Fhtmlpurifier)ArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

protonlabs/htmlpurifier
=======================

Standards compliant HTML filter written in PHP

v4.12.4(2y ago)130.0k1LGPL-2.1-or-laterPHPPHP &gt;=5.2

Since Feb 18Pushed 2y ago4 watchersCompare

[ Source](https://github.com/ProtonMail/htmlpurifier)[ Packagist](https://packagist.org/packages/protonlabs/htmlpurifier)[ Docs](http://htmlpurifier.org/)[ RSS](/packages/protonlabs-htmlpurifier/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (1)Versions (15)Used By (0)

HTML Purifier
=============

[](#html-purifier)

[![Software license](https://camo.githubusercontent.com/558450dc8d3bee14f3725f209be41d83ecedba0ccf108cd24019132f2e96db9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f50726f746f6e4d61696c2f68746d6c70757269666965722e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Latest stable](https://camo.githubusercontent.com/723a602e6dec0352eddfa52118f4bc00e77693b386a3bd31384e219082338530/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f746f6e6c6162732f68746d6c70757269666965722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/protonlabs/htmlpurifier)[![Monthly installs](https://camo.githubusercontent.com/5db15058df8d32a0a3f73bdc418b325e7ed9e9738f354fac4885e76b5d309659/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f70726f746f6e6c6162732f68746d6c70757269666965722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/protonlabs/htmlpurifier/stats)[![Build Status](https://camo.githubusercontent.com/6e6b563e7ddf4d2c288978a4c9a21f4587a0f61d1913b44d7d6017e15f778f49/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f50726f746f6e4d61696c2f68746d6c70757269666965722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ProtonMail/htmlpurifier)

HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and aggressive parsing to ensure that not only are XSS attacks thwarted, but the resulting HTML is standards compliant.

HTML Purifier is oriented towards richly formatted documents from untrusted sources that require CSS and a full tag-set. This library can be configured to accept a more restrictive set of tags, but it won't be as efficient as more bare-bones parsers. It will, however, do the job right, which may be more important.

Places to go:

- See INSTALL for a quick installation guide
- See docs/ for developer-oriented documentation, code examples and an in-depth installation guide.
- See WYSIWYG for information on editors like TinyMCE and FCKeditor

HTML Purifier can be found on the web at:

Installation
------------

[](#installation)

Package available on [Composer](https://packagist.org/packages/protonlabs/htmlpurifier).

If you're using Composer to manage dependencies, you can use

```
$ composer require protonlabs/htmlpurifier

```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 86% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~315 days

Recently: every ~379 days

Total

13

Last Release

1046d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/837170204c2dc6beffb28cfca8ff9036709ac38d5f5f16ab2b8b8a7cb025c089?d=identicon)[BafS](/maintainers/BafS)

![](https://www.gravatar.com/avatar/07337314fa7f579e749eb6f2565747bf75075974867e44153b8382999fc83a42?d=identicon)[bartbutler](/maintainers/bartbutler)

---

Top Contributors

[![ezyang](https://avatars.githubusercontent.com/u/13564?v=4)](https://github.com/ezyang "ezyang (257 commits)")[![xemlock](https://avatars.githubusercontent.com/u/952555?v=4)](https://github.com/xemlock "xemlock (5 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (4 commits)")[![Xiphin](https://avatars.githubusercontent.com/u/3348428?v=4)](https://github.com/Xiphin "Xiphin (3 commits)")[![zerocrates](https://avatars.githubusercontent.com/u/298975?v=4)](https://github.com/zerocrates "zerocrates (2 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (2 commits)")[![mpyw](https://avatars.githubusercontent.com/u/1351893?v=4)](https://github.com/mpyw "mpyw (2 commits)")[![ThHareau](https://avatars.githubusercontent.com/u/9265111?v=4)](https://github.com/ThHareau "ThHareau (2 commits)")[![okainov](https://avatars.githubusercontent.com/u/918446?v=4)](https://github.com/okainov "okainov (1 commits)")[![pawelkania](https://avatars.githubusercontent.com/u/9013316?v=4)](https://github.com/pawelkania "pawelkania (1 commits)")[![PHPGangsta](https://avatars.githubusercontent.com/u/608408?v=4)](https://github.com/PHPGangsta "PHPGangsta (1 commits)")[![r-kovalenko](https://avatars.githubusercontent.com/u/2025625?v=4)](https://github.com/r-kovalenko "r-kovalenko (1 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (1 commits)")[![Darhazer](https://avatars.githubusercontent.com/u/679778?v=4)](https://github.com/Darhazer "Darhazer (1 commits)")[![SandroMiguel](https://avatars.githubusercontent.com/u/6423157?v=4)](https://github.com/SandroMiguel "SandroMiguel (1 commits)")[![skodak](https://avatars.githubusercontent.com/u/241453?v=4)](https://github.com/skodak "skodak (1 commits)")[![stefanotorresi](https://avatars.githubusercontent.com/u/2952427?v=4)](https://github.com/stefanotorresi "stefanotorresi (1 commits)")[![sylfabre](https://avatars.githubusercontent.com/u/3177556?v=4)](https://github.com/sylfabre "sylfabre (1 commits)")[![tmuras](https://avatars.githubusercontent.com/u/695281?v=4)](https://github.com/tmuras "tmuras (1 commits)")[![tyx](https://avatars.githubusercontent.com/u/245494?v=4)](https://github.com/tyx "tyx (1 commits)")

---

Tags

html

### Embed Badge

![Health badge](/badges/protonlabs-htmlpurifier/health.svg)

```
[![Health](https://phpackages.com/badges/protonlabs-htmlpurifier/health.svg)](https://phpackages.com/packages/protonlabs-htmlpurifier)
```

###  Alternatives

[ezyang/htmlpurifier

Standards compliant HTML filter written in PHP

3.4k327.6M445](/packages/ezyang-htmlpurifier)[symfony/html-sanitizer

Provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

27932.2M63](/packages/symfony-html-sanitizer)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)[form-manager/form-manager

PHP-HTML form manager

16041.0k7](/packages/form-manager-form-manager)[aura/input

This package contains tools to describe and filter user inputs from an HTML form, including sub-forms/sub-fieldsets, fieldset collections, an interface for injecting custom filter systems, and CSRF protection. Note that this package does not include output functionality, although the "hints" provided by the Form object can be used with any presentation system to generate an HTML form.

6678.4k4](/packages/aura-input)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
