Skip to content
Researched developer tool comparisonsPrices dated · vendor sources linked · no star ratings
Search

Stage 01 · Write · Researched comparison

Best Rust HTML Parsers in 2026

Start with scraper if you want CSS selectors over a standards-compliant tree, because it builds on html5ever and keeps the API small. Use html5ever directly when you need full control of parsing and tree building. Use lol_html when you need to rewrite HTML as a stream instead of building a full tree. All three are open source and free.

By
Published 27 Nov 2026 · 7 tools compared

We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

  • html5ever is the spec-compliant parser underneath most of the other crates on this list.
  • scraper wraps html5ever with CSS selector queries and suits most scraping and extraction jobs.
  • lol_html streams and rewrites HTML without building a full DOM, which keeps memory use lower on large documents.
  • All seven options here are free and open source, so the choice comes down to API fit and maintenance status.

Who each pick is for

  • Developers who need a spec-compliant HTML5 parser and full controlhtml5ever
  • Scraping and extracting data with CSS selectorsscraper
  • Selector-based parsing on a maintained fork of kuchikikuchikiki
  • Selector-based extraction with a compact APIselect.rs
  • Streaming HTML rewriting without a full DOMlol_html
  • Fast parsing when you need speed over full spec compliancetl
  • Sanitizing untrusted HTML before renderingammonia

Comparison

The 7 tools at a glance
ToolBest forStandout featureListed starting priceFree plan or trial
1html5everDevelopers who need a spec-compliant HTML5 parser and full controlFollows the HTML5 parsing algorithmFree (open source)Free plan
2scraperScraping and extracting data with CSS selectorsSimple CSS selector APIFree (open source)Free plan
3kuchikikiSelector-based parsing on a maintained fork of kuchikiMaintained fork of the archived kuchikiFree (open source)Free plan
4select.rsSelector-based extraction with a compact APISmall, focused selector APIFree (open source)Free plan
5lol_htmlStreaming HTML rewriting without a full DOMStreams and rewrites HTML with low memory useFree (open source)Free plan
6tlFast parsing when you need speed over full spec complianceVery fast parser with a simple APIFree (open source)Free plan
7ammoniaSanitizing untrusted HTML before renderingStrips unsafe markup and attributes by defaultFree (open source)Free plan

How we picked

We picked crates that genuinely parse, query, stream or sanitize HTML in Rust and that have public repositories. Criteria were fit for common jobs (extraction, streaming rewrites, sanitizing), platform support, licence, and maintenance status, including whether a project is archived or low-activity. Sources are vendor pages, crate documentation and project repositories. Prices and licences can change, so confirm on the project site before you commit.

The tools, one by one

01

html5ever

Best for developers who need a spec-compliant HTML5 parser and full control

Visit github.com
html5ever homepage
html5ever homepage, captured Nov 2026

What it is and where it fits

html5ever is the HTML parser from the Servo project. It implements the HTML5 parsing algorithm and lets you plug in a tree builder, so you can produce your own DOM or feed tokens into another structure. It is the parsing core behind several other crates on this list.

The crate runs anywhere Rust runs, including servers, command-line tools and WebAssembly targets. It is dual licensed under MIT and Apache-2.0. There is no paid tier and no hosted service.

Choose html5ever when you need correct handling of malformed markup and want to control the output tree. Skip it if you only want to query elements by CSS selector, because you will have to build that layer yourself or use scraper.

Standout: Follows the HTML5 parsing algorithm

Pricing pointer

Free (open source), as listed by the vendor (html5ever website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Follows the HTML5 parsing algorithm
  • configurable tree builder and sink

Drawbacks

  • Low-level API with a steep learning curve
  • no built-in selector engine

Skip it if this limit matters to you: low-level API with a steep learning curve.

Verdict. A sensible pick for developers who need a spec-compliant HTML5 parser and full control.

Alternatives in this guide: scraper, kuchikiki, select.rs

02

scraper

Best for scraping and extracting data with CSS selectors

Visit github.com
scraper homepage
scraper homepage, captured Nov 2026

What it is and where it fits

scraper parses an HTML document into a tree and lets you query it with CSS selectors. It uses html5ever for parsing, so malformed markup is handled the same way a browser would handle it. The API is small: parse a document, then iterate over matching elements and read their attributes or text.

It runs on any platform that supports Rust, including WebAssembly. The crate is MIT licensed. There is no paid version.

Use scraper for typical extraction work such as pulling links, titles or table rows. Skip it if you need streaming rewrites of very large documents, or if you need XPath-style queries, which it does not provide.

Standout: Simple CSS selector API

Pricing pointer

Free (open source), as listed by the vendor (scraper website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Simple CSS selector API
  • builds on html5ever for parsing

Drawbacks

  • Holds the whole document in memory
  • limited to selector-based queries

Skip it if this limit matters to you: holds the whole document in memory.

Verdict. A sensible pick for scraping and extracting data with CSS selectors.

Alternatives in this guide: html5ever, kuchikiki, select.rs

03

kuchikiki

Best for selector-based parsing on a maintained fork of kuchiki

Visit github.com
kuchikiki homepage
kuchikiki homepage, captured Nov 2026

What it is and where it fits

kuchikiki is a maintained fork of the kuchiki crate, which is archived. It provides an HTML tree built on html5ever plus CSS selector queries, and it also lets you modify nodes and serialize the tree back to HTML. That makes it useful for small transformations, not just extraction.

It runs wherever Rust runs and is licensed under MIT. There is no paid tier.

Pick kuchikiki if you want selector queries plus the ability to edit and re-serialize the document. Skip it if you want the most widely used selector crate, which is scraper, or if you need streaming behavior.

Standout: Maintained fork of the archived kuchiki

Pricing pointer

Free (open source), as listed by the vendor (kuchikiki website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Maintained fork of the archived kuchiki
  • selector API with node manipulation

Drawbacks

  • Smaller community than scraper
  • API surface is broader than simple extraction

Skip it if this limit matters to you: smaller community than scraper.

Verdict. A sensible pick for selector-based parsing on a maintained fork of kuchiki.

Alternatives in this guide: html5ever, scraper, select.rs

04

select.rs

Best for selector-based extraction with a compact API

Visit github.com
select.rs homepage
select.rs homepage, captured Nov 2026

What it is and where it fits

select.rs is a crate for extracting data from HTML using CSS selectors. It parses documents with html5ever and exposes a concise API for finding elements and reading text or attributes. The repository has seen little recent activity, so treat it as a stable but slowly maintained option rather than an actively developed one.

It runs on standard Rust targets and is MIT licensed. There is no paid version.

Use select.rs for small extraction tasks where its API fits and you are comfortable with a low-activity project. For new work with long-term maintenance in mind, scraper is the safer default.

Standout: Small, focused selector API

Pricing pointer

Free (open source), as listed by the vendor (select.rs website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Small, focused selector API
  • works with html5ever parsing

Drawbacks

  • Low recent commit activity
  • fewer features than scraper

Skip it if this limit matters to you: low recent commit activity.

Verdict. A sensible pick for selector-based extraction with a compact API.

Alternatives in this guide: html5ever, scraper, kuchikiki

05

lol_html

Best for streaming HTML rewriting without a full DOM

Visit github.com
LHlol_htmlgithub.com
Homepage screenshot not available; visit the vendor site.

What it is and where it fits

lol_html is a streaming HTML rewriter from Cloudflare. Instead of building a full document tree, it processes HTML as a stream and lets you register handlers that modify elements, attributes or text as they pass through. It is designed for transforming large responses with bounded memory.

It runs on standard Rust targets and is BSD-3-Clause licensed. There is no paid tier.

Choose lol_html when you need to inject, remove or rewrite markup in a stream, such as adding attributes or stripping scripts. Skip it if you need to query the document freely after parsing, because it does not build a queryable tree.

Standout: Streams and rewrites HTML with low memory use

Pricing pointer

Free (open source), as listed by the vendor (lol_html website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Streams and rewrites HTML with low memory use
  • built by Cloudflare for edge use

Drawbacks

  • Not a general DOM for arbitrary queries
  • rewrite model takes time to learn

Skip it if this limit matters to you: not a general DOM for arbitrary queries.

Verdict. A sensible pick for streaming HTML rewriting without a full DOM.

Alternatives in this guide: html5ever, scraper, kuchikiki

06

tl

Best for fast parsing when you need speed over full spec compliance

Visit github.com
tl homepage
tl homepage, captured Nov 2026

What it is and where it fits

tl is a fast HTML parser written in Rust. It focuses on speed and a simple API rather than implementing the full HTML5 tree construction algorithm, so it suits cases where you parse well-formed or mostly well-formed markup and want throughput.

It runs on standard Rust targets and is MIT licensed. There is no paid version.

Use tl when parsing speed matters and you control or trust the input. Skip it if you need browser-grade error recovery on messy real-world pages, where html5ever-based crates are the better fit.

Standout: Very fast parser with a simple API

Pricing pointer

Free (open source), as listed by the vendor (tl website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Very fast parser with a simple API
  • zero-copy string handling

Drawbacks

  • Not a full HTML5 tree builder
  • smaller ecosystem and fewer features

Skip it if this limit matters to you: not a full HTML5 tree builder.

Verdict. A sensible pick for fast parsing when you need speed over full spec compliance.

Alternatives in this guide: html5ever, scraper, kuchikiki

07

ammonia

Best for sanitizing untrusted HTML before rendering

Visit github.com
ammonia homepage
ammonia homepage, captured Nov 2026

What it is and where it fits

ammonia is an HTML sanitizer built on html5ever. It parses input and outputs cleaned HTML, removing tags and attributes that are not on its allowlist. It is aimed at cases where you accept HTML from users and need to render it safely.

It runs on standard Rust targets and is MIT licensed. There is no paid tier.

Use ammonia when the job is sanitizing untrusted markup, such as comments or rich-text input. Skip it if you need to extract data or query a document, since that is not its purpose.

Standout: Strips unsafe markup and attributes by default

Pricing pointer

Free (open source), as listed by the vendor (ammonia website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Strips unsafe markup and attributes by default
  • configurable allowlists

Drawbacks

  • Not a general extraction parser
  • default rules may remove markup you want

Skip it if this limit matters to you: not a general extraction parser.

Verdict. A sensible pick for sanitizing untrusted HTML before rendering.

Alternatives in this guide: html5ever, scraper, kuchikiki

Who should use what

If you are scraping pages and pulling fields, start with scraper. If you need full control over parsing and tree building, use html5ever directly. If you rewrite large responses at the edge, use lol_html. If you accept user HTML and must render it safely, use ammonia. Developers maintaining older code that depends on kuchiki should move to kuchikiki, and anyone choosing select.rs should weigh its low commit activity against scraper.

Questions to settle before you buy

What to check before you buy

  • Confirm the crate is maintained: check recent commits, releases and open issues.
  • Check the licence (MIT, Apache-2.0 or BSD-3-Clause) against your project requirements.
  • Decide whether you need a full tree, a streaming rewriter or only sanitizing.
  • Test on real malformed markup, not just clean samples, if input comes from the web.
  • Verify memory behavior on your largest documents, especially with tree-building crates.

FAQ

Is html5ever a full DOM?

No. html5ever implements the HTML5 parsing algorithm and lets you supply a tree builder. It does not ship a queryable DOM or selector engine by itself. Crates like scraper and kuchikiki build on it to provide those features.

Should I use scraper or select.rs?

scraper has more recent activity and a larger user base. select.rs has a compact API but low recent commit activity. For new projects, scraper is the safer default; select.rs suits small tasks where its API fits.

Can I parse HTML without building a tree?

Yes. lol_html streams HTML and lets you rewrite elements and attributes as they pass through, without building a full document tree. That keeps memory use bounded on large documents.

Is kuchiki still maintained?

The original kuchiki crate is archived. kuchikiki is a maintained fork that provides the same selector-based tree API plus node editing. Use kuchikiki for new work that needs that model.

Does ammonia extract data from HTML?

No. ammonia sanitizes HTML by removing tags and attributes that are not on its allowlist. Use scraper or html5ever when you need to extract data, and ammonia when you need to render untrusted markup safely.

Sources we checked

Method: how we score · editorial policy.

  1. html5ever (official site)
  2. scraper (official site)
  3. kuchikiki (official site)
  4. select.rs (official site)
  5. lol_html (official site)
  6. tl (official site)
  7. ammonia (official site)

Change log. First published 27 Nov 2026.