PHPackages                             wikimedia/remex-html - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. wikimedia/remex-html

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

wikimedia/remex-html
====================

Fast HTML 5 parser

6.0.0(3mo ago)11707.5k↑19.1%15MITHTMLPHP &gt;=8.1

Since Feb 24Pushed 1mo ago15 watchersCompare

[ Source](https://github.com/wikimedia/mediawiki-libs-RemexHtml)[ Packagist](https://packagist.org/packages/wikimedia/remex-html)[ Docs](https://www.mediawiki.org/wiki/RemexHtml)[ RSS](/packages/wikimedia-remex-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (28)Used By (5)

RemexHtml
=========

[](#remexhtml)

RemexHtml is a parser for HTML 5, written in PHP.

RemexHtml aims to be:

- Modular and flexible.
- Fast, as opposed to elegant. For example, we sometimes use direct member access instead of going through accessors, and manually inline some performance-sensitive code.
- Robust, aiming for O(N) worst-case performance.

RemexHtml contains the following modules:

- A compliant preprocessor and tokenizer. This generates a token event stream.
- Compliant tree construction, including error recovery. This generates a tree mutation event stream.
- A fast integrated HTML serializer, compliant with the HTML fragment serialization algorithm.
- DOMDocument construction.

RemexHtml presently lacks:

- Encoding support. The input is expected to be valid UTF-8.
- Scripting.
- Precise compliance with specified parse error generation.

RemexHtml aims to be compliant with W3C recommendation HTML 5.1, except for minor backported bugfixes. We chose to implement the W3C standard rather than the latest WHATWG draft because our application needs stability more than feature completeness.

RemexHtml passes all [html5lib tests](https://github.com/html5lib/html5lib-tests), except for parse error counts and tests which reference a future version of the standard.

**WARNING** This is a new project, we are still developing use cases. So the API is subject to change.

For example code, see `bin/test.php`.

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~126 days

Recently: every ~116 days

Total

27

Last Release

95d ago

Major Versions

1.0.3 → 2.0.02018-08-14

2.3.2 → 3.0.02021-10-24

3.0.3 → 4.0.02023-02-24

4.1.2 → 5.0.02025-06-04

5.1.0 → 6.0.02026-02-13

PHP version history (5 changes)1.0.3PHP &gt;=5.5.9

2.0.0PHP &gt;=5.6.99

2.2.0PHP &gt;=7.2.9

4.0.0PHP &gt;=7.4

5.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b94d9718c06ec7c3fd7a104bc44966fb7464b9ec7411582343ea35a7a6a85f08?d=identicon)[mediawiki](/maintainers/mediawiki)

![](https://www.gravatar.com/avatar/716c86d71cbf921e7912a505f89d799de398fc0a3af0bd4c8862834b2d642bd7?d=identicon)[wikimedia](/maintainers/wikimedia)

![](https://www.gravatar.com/avatar/3551c2aefb299a0c45807f7677f5b26d8a5be4a4af359b4bf4fabbdd1f2b990e?d=identicon)[cscott](/maintainers/cscott)

---

Top Contributors

[![cscott](https://avatars.githubusercontent.com/u/156080?v=4)](https://github.com/cscott "cscott (77 commits)")[![tstarling](https://avatars.githubusercontent.com/u/389141?v=4)](https://github.com/tstarling "tstarling (68 commits)")[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (41 commits)")[![jdforrester](https://avatars.githubusercontent.com/u/881572?v=4)](https://github.com/jdforrester "jdforrester (15 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (13 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (7 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (3 commits)")[![Krinkle](https://avatars.githubusercontent.com/u/156867?v=4)](https://github.com/Krinkle "Krinkle (3 commits)")[![subbuss](https://avatars.githubusercontent.com/u/91608?v=4)](https://github.com/subbuss "subbuss (3 commits)")[![tgr](https://avatars.githubusercontent.com/u/145412?v=4)](https://github.com/tgr "tgr (2 commits)")[![arlolra](https://avatars.githubusercontent.com/u/123708?v=4)](https://github.com/arlolra "arlolra (2 commits)")[![xSavitar](https://avatars.githubusercontent.com/u/4872561?v=4)](https://github.com/xSavitar "xSavitar (1 commits)")[![ayg](https://avatars.githubusercontent.com/u/940446?v=4)](https://github.com/ayg "ayg (1 commits)")[![Daimona](https://avatars.githubusercontent.com/u/38216014?v=4)](https://github.com/Daimona "Daimona (1 commits)")[![MaxSem](https://avatars.githubusercontent.com/u/1260606?v=4)](https://github.com/MaxSem "MaxSem (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wikimedia-remex-html/health.svg)

```
[![Health](https://phpackages.com/badges/wikimedia-remex-html/health.svg)](https://phpackages.com/packages/wikimedia-remex-html)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

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