HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
servo
html5ever
Rust2015–2026
servo / html5ever

html5ever

High-performance browser-grade HTML5 parser

12Distinct people
12Mentions
0Explicit recommenders
2.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

High-performance browser-grade HTML5 parser

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:04:58 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year12 dated mentions

Observed mentions: 2015-01-20 07:40:43 UTC to 2026-01-26 21:32:51 UTC.

01232015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC303
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC110
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

12 sources
I haven't really looked at the fastrender project to say how much of a browser it implements itself, but it does depend on at least one servo crate: cssparser (https://github.com/servo/rust-cssparser). Maybe there is a main servo crate as well out there, and fastrender doesn't depend on that crate, but at least in my mind fastrender depends on some servo browser functionality. EDIT: fastrender also includes the servo HTML parser: html5ever (https://github.com/servo/html5ever).
In When AI 'builds a browser,' check the repo before believing the hype
I think it's fair enough to consider porting a subset of rewriting, in which case there are several successful experiments out there: - JustHTML [1], which in practice [2] is a port of html5ever [3] to Python. - justjshtml, which is a port of JustHTML to JavaScript :D [4]. - MiniJinja [5] was recently ported to Go [6]. All three projects have one thing in common: comprehensive test suites which were used to guardrail and guide AI. References: 1. https://github.com/EmilStenstrom/justhtml 2. https://friendlybit.com/python/writing-justhtml-with-coding-... 3. https://github.com/servo/html5ever 4. https://simonwillison.net/2025/Dec/15/porting-justhtml/ 5. https://github.com/mitsuhiko/minijinja 6. https://lucumr.pocoo.org/2026/1/14/minijinja-go-port/
In Cursor's latest “browser experiment” implied success without evidence
That's largely correct. HTML5 changed the status quo from "eh, it should be XML but every browser applies its own weird hacks" to "well, the hacks still apply but at least they're defined by the standard now". The proper solution would have been XHTML, but we can't have nice things. This seems to use html5ever[0], which is a "proper" HTML browser also used by the Servo browser. [0]: https://github.com/servo/html5ever
In Htmlq: Like Jq, but for HTML

Ask HN: A fast, Rust HTML parser that works?

So I'm doing some web scraping in Rust, and so I will need to parse HTML. [scraper](https://docs.rs/scraper/latest/scraper/) (which uses [html5ever](https://github.com/servo/html5ever)) is doing fine except that it's the bottleneck of my application. So I need a faster parser. I've tried [tl](https://docs.rs/tl/latest/tl/) which would've been perfect except that it doesn't actually work on the HTML I have. When I try to `query_selector` the elements I need, it returns nothing. [Kuchiki](https://docs.rs/kuchiki/latest/kuchiki/) is abandonded. I couldn't figure out how to get [lol-html](https://github.com/cloudflare/lol-html) to work for me (it's designed for re-writing HTML, whatever that means). It doesn't seem to have an API to extract the inner text of an element. [html5gum](https://github.com/untitaker/html5gum) seems to be just an HTM
Read the rest
L tokenizer, or otherwise just too low-level. I have not yet tried [quick-xml](https://github.com/tafia/quick-xml/) but judging from the README, it's pretty low-level too. I mean, if these are the only options left then I will try them. Otherwise, I would love to use a parser that's faster but as ergonomic as `scraper` or `tl`. At this point, I would be happy with an Lxml bridge/port of some sort. I don't need to mutate HTML, just parse and read data from it.
2 points · Open discussion
Perhaps a better comparisson is this: https://github.com/servo/html5ever/blob/master/html5ever/src... https://html.spec.whatwg.org/multipage/parsing.html#data-sta... Where spec: U+0000 NULL -> This is an unexpected-null-character parse error. Emit the current input character as a character token. translates into: FromSet('\0') => go!(self: error; emit '\0'), If you ignore the FromSet which is used for small set of characters, and `go!` which is a macro, you get something akin to: '\0' => emit_error; emit '\0'
In Show HN: Python bindings to the Servo HTML5 parser, html5ever
You probably would add the most value by improving the maturity level of existing libraries. Some that I've run across that exist but don't really give me much confidence in using them in production include: https://github.com/sbeckeriv/warc http://techern.github.io/Varint-rs/varint/index.html https://github.com/hyperium/hyper https://github.com/rusoto/rusoto https://github.com/servo/html5ever (largely on the performance front; on a recent test of GZip + WARC reading + HTML parsing, Kotlin (on the JVM) + WebArchive Commons + JSoup beat Rust + warc_nom_parser + html5ever by about 25%, which does not fit with Rust's reputation as a fast systems programming language) And libraries that I wish existed but which don't really have good options: Web crawling. Hyper is listed above as an HTTP library, but there's nothing like Apache Nutch which
Read the rest
respects hostloads and robots.txt and works as a turn-key solution. RSS parsing. RSS serialization works, and people have written toy RSS readers, but nobody's written a robust, self-contained RSS parsing library. Machine learning. It was a shame when Autumn.io gave up Leaf. Big data. Create a Hadoop/Spark alternative in Rust and the world will love you, at least if you can beat Hadoop's reliability, performance, and ease-of-use.
In Ask HN: Requested Rust libraries and/or interesting projects
> https://github.com/servo/html5ever is the largest parsing library we use in Servo, and there are a bunch of Rust tricks done there. HTML parsing is hard (the spec is insanely complex), and this library does it well with much less code. This might simply be because of a) Servo has no legacy b) Servo developers are awesome c) Servo is not complete yet A large part of the complexity of HTML is simply quirks and compatibility. Which Servo does not handle yet. Don't mistake all this as language wins...
In A Taste of Rust
This is a great post! :D Some nits on various errors or misrepresentations: > pragma You have some complaints about attributes (what you call pragmas) -- I suspect that many of them are due to you looking at them as if they were C++ preprocessor directives or pragmas. They aren't, even if the syntax may be reminiscent :) In some cases they're like decorators in python (but much more powerful), in others, Java annotations. They're a different concept. > Sadly, Rust is not a target for my favorite parser generator, and the lexers in Servo don’t look much better than C-style state machines, with lots of matching (switching) on character literals. https://github.com/servo/html5ever is the largest parsing library we use in Servo, and there are a bunch of Rust tricks done there. HTML parsing is hard (the spec is insanely complex), and this libr
Read the rest
ary does it well with much less code. > it would be nice if the Rust compiler got rid of the split_at_mut secret password and could reason sanely about slice literals and array indexes. `split_at_mut` is just a library function that uses `unsafe` internally, much like many other core data structures and methods. It has nothing to do with the compiler. > It is also worth noting that processing non-overlapping slices in parallel is destined to come into mortal conflict with The Iterator, which is by its nature sequential. I believe the thread::scoped API can be used to process nonoverlapping slices in parallel with a regular iterator. Not sure, but I recall seeing an example where this was done. > ...seems like an excessive amount of ceremony, at least for a language that keeps using the word “systems” on its website. I don't see what verbosity has to do with systems programming. Most of those are zero or low cost (so verbosity doesn't correspond to more steps in the generated assembly); I believe there's a utf8 check at one point and that's it. Rust is verbose wherever errors or footguns are possible. > Rust won’t read C header files, so you have to manually declare each function you want to call by wrapping it in an extern block, like this: https://github.com/crabtw/rust-bindgen > but until a few days ago, Cargo didn’t understand linker flags You can specify -L and -l flags in the .cargo/config file under the rust-flags key (or output the same in a build script); this has been allowed for a while now. More complex linker args are now possible with the cargo rustc command.
In A Taste of Rust
Where did the 10% number come from? FWIW, I just looked at the code in the mozilla/servo repository: more than half (1291) of all mentions of 'unsafe' (2150) are inside autogenerated bindings to CEF (Chromium Embedding Framework), which doesn't seem at all like the interesting/relevant part of the application (it's providing an optional "minimal working" browser chrome for the rendering engine). A lot of the other uses are similarly for other FFI tasks, interfacing with libraries like FreeType, HarfBuzz and Spidermonkey. Obviously it would be nice for those libraries to be in Rust and thus avoid the FFI-is-always-unsafe , but the ecosystem is still young and those libraries are seriously non-trivial, Mozilla and the Servo team presumably want to be able to do the interesting parts of their experimentation rather than spending years portin
Read the rest
g all the low-level libs to Rust first. For some "success stories", Servo's CSS parser was now pure Rust, and has a single `unsafe` block: https://github.com/servo/rust-cssparser/blob/38877bc0a50a64a... . Similarly, the pure Rust HTML parser written for Servo doesn't have much unsafe (certainly very little compulsory unsafe, most exists in an alternate DOM implementation, or in the C interface the library exposes): https://github.com/servo/html5ever That said, Rust is definitely not perfect in this regard, three of the major failings with Rust that force Servo to have a unsafe code are insufficient data-parallel libraries, lack of inheritance-like features to allow the DOM to be CPU and memory efficient, and lack of garbage collection hooks in the compiler. > The ownership syntax is a bolt-on, and it shows. Could you go into more detail about what you mean by this?
In Explore the ownership system in Rust

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.