Skip to main content

What a web page costs in tokens, measured on ten public pages

Raw HTML, markdown, readability and text output for the same ten pages, counted in o200k tokens. Markdown cut the bill 15x at the median, and readability mode left four index pages with under 60 tokens.

Jeff Mendez 4 min read

An agent that reads the web pays for every page twice. Once to fetch it, and again every time the page sits in the context window. The second bill is the one that grows, and it depends on which form of the page you kept. I wanted a number instead of a feeling, so on 2026-11-05 I fetched ten public pages through our scrape endpoint in four output formats and counted the tokens.

The run

Ten pages, chosen for shape rather than fame: a Wikipedia article, four documentation pages (Python, MDN, Kubernetes, React), a GitHub repository page, two news front pages (BBC, the Guardian), the Hacker News front page and the gov.uk organisations index. Each one fetched four times with return_format set to raw, markdown and text, plus markdown with readability: true. Tokens counted with gpt-tokenizer 4.0.0 using the o200k_base encoding.

Two pages from the original list of twelve are out of the table. Stack Overflow answered with a 403, and the arXiv abstract came back as a 6.8 KB stub whose markdown was 38 bytes. I report both because a benchmark that hides its misses is an ad.

Pagerawmarkdownreadabilitytext
en.wikipedia.org, Web scraping60,91813,4916,8656,411
docs.python.org, asyncio3,8401,070488569
developer.mozilla.org, HTTP 42920,559622191,924
kubernetes.io, concepts overview120,4952,5731,9625,983
react.dev, learn83,2694,4732,9353,602
github.com, spider-rs/spider51,1454,2951,7471,240
bbc.com, news front page109,2555,780211,685
theguardian.com, international453,52021,4255144,100
news.ycombinator.com11,3053,90631,179
gov.uk, organisations118,09729,394596,197

Tokens per page, o200k_base, 2026-11-05. Totals across the ten: 1,032,403 raw, 87,029 markdown, 32,890 text, 14,613 readability.

What the numbers say

Markdown cut the token count by 15x at the median, with a range of 2.9x on Hacker News to 47x on the Kubernetes page. The spread is the interesting part. Hacker News is already mostly text, so there is little to strip. The Kubernetes overview is a short chapter wrapped in a 480 KB shell of navigation, scripts and inline SVG, and almost all of it goes.

Text came in smaller than markdown on 8 of the 10 pages, 19.6x at the median. The difference is link targets and heading marks. That is exactly the material an agent uses to decide what to fetch next, so text is the right format when the page is the answer and the wrong one when the page is a step in a crawl. The two exceptions, MDN and Kubernetes, are pages where the markdown converter dropped boilerplate that the text path kept.

Readability is the one I would warn about. On the article pages it did what it says: the Wikipedia article halved again, the React chapter lost a third, the GitHub page kept the README and dropped the rest. On the four index pages it returned 3, 19, 21 and 59 tokens. A front page has no single body for the Reader algorithm to find, so it keeps almost nothing, and the response still comes back as a 200. If your pipeline turns readability on globally, your agent will read the BBC front page as a single sentence and believe it.

What to do with this

Set the format per page type, not per pipeline. Markdown is the safe default for anything an agent will navigate from. Text is for pages you are summarizing and discarding. Readability is for pages you already know are articles, with a byte-length check on the result so an empty body fails loudly instead of landing in your embeddings.

If you store raw HTML today, the median page in this run is 72,093 tokens raw against 4,384 as markdown. At any per-token price, that gap is the difference between a context window that holds one page and one that holds sixteen.

Reproduce it with your own URLs. The call for one format is a single request:

curl -s https://api.spider.cloud/scrape \
  -H "Authorization: Bearer $SPIDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://kubernetes.io/docs/concepts/overview/", "return_format": "markdown", "readability": false}'

Swap return_format and readability, count the content field with the tokenizer your model uses, and compare against the raw fetch. For HTML you already hold, the transform endpoint converts it without fetching again. Start with one page you are paying for right now and see what it costs in each form.

Frequently asked questions

How many tokens is a typical web page?

In this run of ten public pages fetched on 2026-11-05, the raw HTML ran from 3,840 tokens for a Python docs page to 453,520 for the Guardian's international front page, counted with the o200k_base encoding. The same pages as markdown ran from 622 to 29,394 tokens.

Does markdown or plain text use fewer tokens?

Text was smaller on 8 of the 10 pages in this run, because it drops link targets and heading marks. Markdown keeps the links and the structure, which an agent usually needs to decide what to fetch next. Pick text when the page is the final answer, markdown when it is a step.

When should I turn on readability?

On article pages. Readability keeps the main body of a Wikipedia article or a React docs chapter and drops the chrome. On index pages such as a news front page or Hacker News it returned under 60 tokens in this run, because there is no single body to keep.

Which tokenizer was used?

gpt-tokenizer 4.0.0 with the o200k_base encoding, the one GPT-4o class models use. Other model families tokenize differently, so treat the ratios as the stable part and the absolute counts as approximate for your model.

Sources

  1. Measured run, 2026-11-05: ten public pages, four output formats each, through the Spider scrape endpoint
  2. gpt-tokenizer (o200k_base encoding)
  3. Mozilla Readability, the algorithm behind the readability flag
  4. Spider transform endpoint, for HTML you already have

Keep reading

Introducing Silk: our custom AI model for web data extraction

Silk is Spider's own extraction model. It turns raw HTML into structured data and handles challenge pages on our GPUs, with no external API calls and no per-token billing.

Scraping 1 million pages: what actually happens

An engineering log of crawling 1 million pages across 10,000 domains with Spider's API. Throughput curves, failure modes, cost breakdown, and lessons learned.

Spider Browser passes 80/80 on Browser Fidelity Bench

Spider Browser passed all 80 tasks on Browser Use's Browser Fidelity Bench V1 in September, up from 68 in March. Every other cloud browser tested scored lower.

Run this on a page you care about

The playground sends the request this page describes and shows you the response. Keyless runs work without an account and are rate limited.