.NET 9 · .NET 10 · .NET 11 · built on z3l.FastHtmlParser

The article of any page in a millisecond

Mozilla's Readability for .NET: the title, author, date, image and the text of a page without the menus, sidebars, comments and ads around it.

Try:


      
      
      
      

One call from a page to its article

A static method, the HTML and its address in, the article with its metadata out.

  • 1
    Metadata firstTitle, author, date, site and image from JSON-LD, Open Graph, Twitter and Dublin Core; from the page itself when they are missing.
  • 2
    Ready for a language modelThe article as Markdown, as text with its paragraphs, or as clean HTML that is safe to show.
  • 3
    A quick test firstIsProbablyReadable tells in microseconds whether a page has an article at all: pass over lists and search pages.
  • 4
    No AngleSharpNo dependencies but the parser, no reflection, trimming and Native AOT compatible, thread-safe.
$dotnet add package z3l.FastHtmlParser.Readability
using z3l.FastHtmlParser;

var article = Readability.Parse(html, "https://example.com/news/1");
if (article != null)
{
    Console.WriteLine(article.Title);
    Console.WriteLine(article.Byline);          // "By Jane Doe"
    Console.WriteLine(article.PublishedTime);   // "2026-11-20T08:00:00Z"

    string markdown = article.Markdown;         // for a language model
    string text = article.TextContent;          // paragraphs and lines
    string clean = article.Content;             // clean HTML, safe to show
}

// a quick test: lists, search results and the like have no article
bool worthIt = Readability.IsProbablyReadable(html);

Readability's method, without changing the page

The rules are those of the reader view of Firefox. The page is read as the parser recorded it: what Readability removes is only marked, and the text of every element is counted in one pass.

Paragraphs score their parents

Each paragraph of 25 chars and more gives points to its parent and grandparent, more for its commas and length; the share of link text lowers the points.

Sidebars and comments out

Hidden elements, menus and the parts whose class or id says sidebar, comment, footer, share or ad are left out; in the article, lists of links and forms too.

Content that is safe to show

The article is written by the HTML sanitizer of the parser: no scripts, styles, classes or ids; links and lazy images absolute.

Checked on Mozilla's test pages

On the 130 test pages of Mozilla Readability the text of the article matches the expected one at 0.99 (F1 by words), and 498 of 502 metadata fields are the same.

Metadata from everywhere

JSON-LD articles (also in @graph), Open Graph, Twitter cards, Dublin Core, Parse.ly; a byline in the page; the title without the site name.

When the article is short

Under 500 chars of text, the page is read again with fewer rules, as Readability does, and the longest result is taken.

What it is not. It reads the HTML it is given: it does not run JavaScript, so a page that builds its article in the browser needs its HTML from a headless browser first. Video embeds are left out of the article.

Benchmarks on real articles

From the HTML string to the article with its metadata and text. Test pages of Mozilla Readability, BenchmarkDotNet, .NET 10, AMD Ryzen 7 3800X. Shorter is better.

Time

Memory allocated

SmartReader 0.11.1 is the .NET port of Mozilla Readability on AngleSharp. The code and all the numbers: benchmarks/README.md.

Free for most, one price for the rest

The license of FastHtmlParser: free for individuals and for organizations under USD 1M of annual revenue and under 100 people, commercial use included. Larger organizations pay USD 1,000 once, for every z3l library.

See the pricing Read the license

Questions

I already use z3l.FastHtmlParser. Do I need this package?

No. The extractor is a part of the parser: doc.Article() and doc.IsProbablyReadable(). This package is the parser with one more class, Readability, for those who look for it by name. They can be installed together.

How is it different from SmartReader?

Both follow Mozilla Readability. SmartReader builds an AngleSharp DOM and changes it as Readability does; this one marks what Readability removes on the parser's list of tags and counts the text in one pass: 11–23x faster with 14–40x less memory. Its Content is written by a sanitizer, so it is always safe to show.

Why is the byline "By Jane Doe" and not "Jane Doe"?

When the page has no author in its metadata, the byline is the text of the element that holds it, as Readability takes it. With JSON-LD or an author meta tag it is the name alone.

What does this demo do with the pages I load?

The server loads the page and extracts the article; nothing is kept, written to disk or logged. Only public http / https addresses are loaded, up to 5 MB.

Do I need a commercial license?

Only if your organization, together with its affiliates, has USD 1,000,000 or more in annual revenue, or 100 or more employees and contractors. Everyone else uses it free, including in commercial products.