Skip to main content

Guide Β· Content extraction

Best Tools to Turn Web Pages into Markdown for LLMs

Last reviewed

We earn commissions when you shop through the links below.

Raw HTML is mostly menus, scripts and cookie banners, and feeding it to a model wastes context and muddies answers. The real decision is where the cleanup happens: a library in your own code for static pages, an open source crawler you run yourself, or a hosted API that renders JavaScript-heavy pages and hands back markdown. Libraries cost nothing but break on pages that need a browser. Hosted APIs save that work but bill per page, so match the tool to how many pages you fetch and how messy they are.

Quick pick

Quick markdown from one URL with no setup
Jina Reader
Extract the main article text in Python
Trafilatura
Clean article HTML in JavaScript, then convert it
Mozilla Readability with Turndown
Open source crawler you run yourself
Crawl4AI
Hosted API for JavaScript-heavy pages and whole sites
Firecrawl
Full control over the browser and the cleanup
Playwright DIY

The options, and when to use each

Jina Reader

hostedURL prefix

Use it for: You want LLM-friendly text from a page by putting r.jina.ai/ in front of the URL, with nothing to install.

Tradeoff: Less control over what gets kept or dropped, and heavy use means rate limits or an API key.

Mozilla Readability

open sourceJavaScriptlibrary

Use it for: You already have the HTML and want the main article pulled out, the same approach as Firefox Reader View.

Tradeoff: Outputs cleaned HTML, not markdown, and works poorly on pages that are not article shaped, like docs indexes or product grids.

Turndown or Markdownify

open sourceHTML to markdown

Use it for: You need a plain HTML to markdown converter: Turndown in JavaScript, python-markdownify in Python.

Tradeoff: They convert everything you hand them, so without a cleanup step first you get the nav and footer too.

Trafilatura

open sourcePython

Use it for: A Python pipeline that pulls main text and metadata from many static pages and can output markdown.

Tradeoff: It does not run JavaScript, so pages that render content in the browser come back thin or empty.

Crawl4AI

open sourcebrowser basedself-host

Use it for: You want an open source crawler that renders pages in a browser and returns markdown for RAG, on your own machines.

Tradeoff: You run the browsers, proxies and scaling yourself unless you pay for their hosted cloud.

Firecrawl

hosted APImarkdown or JSONcrawl

Use it for: You want one API call that renders the page and returns clean markdown, including JavaScript-heavy pages and whole sites.

Tradeoff: Usage-based billing per page, and your content passes through a third party, which a free library avoids.

Apify Website Content Crawler

hostedcrawlermarkdown

Use it for: You want a ready-made crawler on a scraping platform that outputs markdown or text for feeding into an LLM.

Tradeoff: More platform to learn than a single API, and costs depend on how much compute your runs use.

Playwright DIY

open sourceheadless browserbuild it yourself

Use it for: You need logins, clicks or custom waits before extracting, and pair it with Readability and Turndown yourself.

Tradeoff: You own every piece: browser upkeep, blocked requests, retries and the cleanup rules for each site.

Skills that use these tools