buildwiththis home

Best free tool to turn web pages into clean text for AI: Trafilatura vs Readability

Your agent, scraper or RAG pipeline needs the actual article text from web pages, without menus, cookie banners, related links and footers eating your tokens.

Last tested Oct 16, 2026 Re-test due by Nov 15, 2026 Published Oct 16, 2026 Test log (3 entries)

Our pick
Trafilatura100/100
Why
Text on all 181 pages, F1 0.953 (precision 0.928, recall 0.978). 11.5 ms a page and 97 MB of memory. Markdown output, title/author/date, its own downloader and a command line. Python, Apache-2.0.
Not for you if
you work in JavaScript or the browser and want no Python: Mozilla Readability was just as accurate, and in a browser you already have the DOM it needs.

Short answer: Use Trafilatura (100/100). On 181 real news and blog pages it kept 98% of the article text with little junk (F1 0.953), at 11 ms a page and under 100 MB of memory, and it outputs Markdown for your LLM. Mozilla Readability was just as accurate (F1 0.947), but in Node.js it was 5 times slower and used 1.3 GB.

The verdict

Winner

Trafilatura

100/100

An open-source Python library and command-line tool that downloads web pages and extracts the main text, comments and metadata.

7 of 7 checks. Text on 181 of 181 pages, F1 0.953 (precision 0.928, recall 0.978), 94% of pages at F1 0.80 or better. 11.5 ms a page and 97 MB of memory, offline. Markdown, JSON with metadata, a downloader and a CLI built in. Score: 100/100.

Visit Trafilatura

Runner-up

Mozilla Readability

80/100

The standalone version of the code behind Firefox Reader View, in JavaScript.

5 of 7. Text on 181 of 181 pages, F1 0.947 (precision 0.914, recall 0.982), 96% of pages at F1 0.80 or better. But in Node.js with jsdom it took 60 ms a page and peaked at 1.3 GB, and it has no Markdown output, downloader or CLI. Score: 80/100.

Visit Mozilla Readability

On this page
  1. Quick answers
  2. Why
  3. Results on 181 pages
  4. Gotchas
  5. Scores
  6. What it costs
  7. Caveats
  8. Not tested yet
  9. Test log
  10. Affiliate disclosure
  11. Sources

Quick answers

What's the best free tool to extract the main text from a web page?

In our test, Trafilatura. On 181 hand-labelled news and blog pages it returned text for every page with an F1 of 0.953 (precision 0.928, recall 0.978), at 11.5 ms a page and 97 MB of memory, offline. It scored 100/100.

Is Trafilatura better than Readability?

About as accurate (F1 0.953 vs 0.947; Readability kept slightly more text, Trafilatura added slightly less junk), but much lighter: 11.5 ms vs 60 ms a page and 97 MB vs 1.3 GB in our Node.js run. Trafilatura also outputs Markdown, downloads pages and has a CLI; Readability does none of those.

Can Trafilatura output Markdown for an LLM?

Yes: extract(html, output_format="markdown"). It also outputs plain text, JSON with metadata, HTML, XML and CSV.

Does Readability work in Node.js?

Yes, with jsdom, as its README shows. The current jsdom (30) needs Node 22.22 or newer; it failed to load on Node 20.

Can I trust these numbers when the benchmark already lists both tools?

We ran both ourselves with today's versions. Readability matched its published F1 exactly (0.947); Trafilatura 2.3.1 scored 0.953 against 0.958 published for 2.0.0, within the error bar. The benchmark is run by Zyte, which sells an extraction API; Trafilatura's author contributed its runner.

Why

Who this is for: you’re building an agent, a scraper or a RAG pipeline and need the article text from web pages, without paying for the menus, cookie banners, “related stories” and footers in tokens, or letting them confuse the model.

Our pick: Trafilatura (100/100). On 181 real news and blog pages it kept 98% of the article text and added little junk, at 11 milliseconds a page and under 100 MB of memory. It gives you Markdown for your LLM, title, author and date, its own downloader and a command line.

Runner-up: Mozilla Readability (80/100). The code behind Firefox Reader View was just as accurate. In Node.js, though, it needs jsdom to parse the page, which made it 5 times slower and used 1.3 GB, and it doesn’t do Markdown, downloading or a CLI. Pick it if you’re in JavaScript or a browser and don’t want Python.

Results on 181 pages

CriterionTrafilatura 2.3.1Readability 0.6.0
Pages with text181 / 181181 / 181
F1 (benchmark scoring)0.9530.947
Precision (how little junk)0.9280.914
Recall (how much article kept)0.9780.982
Pages at F1 0.80 or better94%96%
Time per page (median)11.5 ms60.4 ms
Peak memory97 MB1,338 MB
Markdown outputYesNo
Downloads pagesYesNo
Command lineYesNo

F1, precision and recall come from the benchmark’s own scoring code, which compares overlapping word sequences with the hand-labelled text, so order matters.

Gotchas

Trafilatura refuses private addresses. Its downloader blocks non-public IP addresses (to stop server-side request forgery). That’s a good default, but it broke the README example on our test machine, whose network proxy uses a private address. If you run behind such a proxy, download with your own HTTP client and pass the HTML to extract().

Readability needs Node 22 in Node.js. The current jsdom won’t load on Node 20, but npm still installs it there, so the error only shows up when your code runs.

Readability: close your jsdom windows. The README example doesn’t, and memory climbed to 1.3 GB over 181 pages. In a long-running process, call window.close() after each page.

Neither runs JavaScript. They read the HTML you give them. Pages that build their content with JavaScript need a headless browser first.

Scores

Scored with our published rubric. Tested 2026-10-16. One run each: the gap was 20 points.

CriterionTrafilaturaReadability
Task success (35)5 (7 of 7)3 (5 of 7: speed, memory)
Effort (15)5 (no fixes)5 (no fixes; needed Node 22)
Time (10)5 (minutes)5 (minutes)
Cost (10)5 ($0, runs locally)5 ($0, runs locally)
Quality of what you get (10)5 (5 of 5)2 (2 of 5: no Markdown, downloader or CLI)
Ownership (10)5 (Apache-2.0)5 (Apache-2.0)
Privacy and safety (10)5 (4 of 4)5 (4 of 4)
Total10080

The 7 checks: text on at least 95% of pages, F1 of at least 0.90, precision and recall of at least 0.90 each, at least 90% of pages at F1 0.80, a median of at most 50 ms a page, and at most 1 GB of memory.

What it costs

Both are free and open source (Apache-2.0) with no usage limits. Our runs cost $0.

Caveats

  • Not our data, and not new numbers. The pages and labels are Zyte’s public benchmark, which already lists scores for both tools. Zyte sells an extraction API, and Trafilatura’s author contributed its runner there. We ran both tools ourselves with today’s versions: Readability matched its published F1 exactly, and Trafilatura was within the error bar of its published score. What we add is speed, memory, safety and features.
  • News and blog articles only. Product pages, docs sites, forums and search results weren’t tested.
  • Defaults only. Trafilatura has precision and recall settings that we left alone.
  • Runs were done by an AI agent following each tool’s README, with the network off. Details and the check script are in the test script and here.

Next step: automate what happens next. See our tested pick for automating a workflow on your own server, or pull data out of documents with our PDF tables pick.

Not tested yet

  • Hosted reader APIs (Jina Reader, Firecrawl, Zyte API): need accounts, and some need a card.
  • Browser-based scrapers for JavaScript-heavy pages (Crawl4AI, Playwright plus an extractor).

Test log

DateAgentStepResult
Oct 16, 2026Lando (agent)Setup for both: the 181 saved news and blog pages and hand-labelled article text from Zyte's open article-extraction-benchmark (MIT, commit 4a3bc97), read from disk with the network off. Scored with the benchmark's own text-matching code, plus speed, memory and safety checks.Script frozen before the runs. Both tools are Apache-2.0 with no benchmarking restrictions.
Oct 16, 2026Lando (agent)Trafilatura 2.3.1, run traf-r1: pip install trafilatura, then trafilatura.extract(html) with default settings on every page.7 of 7. F1 0.953, text on every page, 11.5 ms a page, 97 MB. Score: 100/100.
Oct 16, 2026Lando (agent)Mozilla Readability 0.6.0, run rjs-r1: npm install @mozilla/readability jsdom, then new JSDOM(html, {url}) and new Readability(document).parse() as in the README, scoring textContent. jsdom 30 needed Node 22, so we installed it.5 of 7. F1 0.947, text on every page, but 60 ms a page and 1.3 GB peak memory. Score: 80/100.

Affiliate disclosure

This page has no affiliate links yet. Every link goes to the tool’s own homepage. Affiliate deals never decide a pick, and a tool with no affiliate program can still win. How we make money.

Sources