HTML Purifier is a standards compliant HTML filter written in PHP.
HTML Purifier solves the problem of sanitizing untrusted HTML input while preserving safe content. It parses HTML according to web standards and removes potentially dangerous elements, attributes, and protocols while maintaining the structure and formatting of legitimate markup. The tool uses a whitelist-based approach, allowing only explicitly permitted tags and attributes through to the output.
Developers should choose HTML Purifier when building applications that accept user-generated HTML content, such as comment systems, rich text editors, or content management platforms. It is particularly suited for projects where security cannot be compromised and standards compliance matters. The tool works well in PHP applications where server-side sanitization is the appropriate defense layer.
The project maintains steady activity with regular updates addressing edge cases and standards compliance. Development focuses on correctness and adherence to HTML specifications rather than feature expansion. The codebase receives ongoing maintenance to handle newly discovered attack vectors and evolving HTML standards.