# How many tokens does markdown actually save?

Generated by `analyse.py`. Rule sealed as `rule.markdown-vs-html`, `f89e82653c48f0dc18c6cf25293fdfb34d988be01070d19e1c8a99fd533b62df`, before the first page was fetched.

## Controls

| control | what it checks | result |
| --- | --- | --- |
| POSITIVE | constructed M = 3.00, measured M = 3.002, error 0.05 % | **PASS** |
| NULL | already-plain-text document: reported saving R_naive = -0.0090 (bar: below 0.10) | **PASS** |
| INSTRUMENT | 193 pages from 66 domains (bars: 60 and 25) | **PASS** |

## The corpus

193 article pages from 66 domains, drawn from feeds as the rule describes, fetched 2026-09-21.

Excluded, by reason, out of 217 URLs drawn: no_visible_text 3, status_0 2, status_403 18, status_500 1.

## Verdicts

Median over pages, 95 % interval from a 2000-draw page-level bootstrap at seed 20260921. The per-domain column medians within each site first, because the site is the sampling unit; where the two disagree the sealed rule says the per-domain one governs.

| claim | quantity | bar | median (per page) | 95 % CI | per domain | verdict |
| --- | --- | --- | --- | --- | --- | --- |
| **C1** (primary) | `R_naive` | >= 0.65 | 0.9090 | 0.8793 - 0.9170 | 0.9069 (0.8687 - 0.9253) | **SURVIVES** |
| **C2** (primary) | `K_naive` | >= 0.95 | 2.8241 | 2.5589 - 3.1229 | 2.8202 (2.2859 - 3.2170) | **SURVIVES** |
| **C3a** (secondary) | `R_extract` | >= 0.65 | 0.9813 | 0.9772 - 0.9874 | 0.9797 (0.9733 - 0.9895) | **SURVIVES** |
| **C3b** (secondary) | `K_extract` | >= 0.95 | 0.5861 | 0.5311 - 0.6343 | 0.5958 (0.5384 - 0.6859) | **KILLED** |
| **C4** (primary) | `M` | >= 10.00 | 30.3075 | 26.2286 - 34.9176 | 29.2688 (24.5480 - 37.0831) | **SURVIVES** |

- **C1 — SURVIVES.** Converting a web page to markdown cuts tokens by 65-90 % (naive conversion)
- **C2 — SURVIVES.** "with no content loss" - naive conversion keeps the visible text
- **C3a — SURVIVES.** the same saving for an extractor (trafilatura 2.2.0)
- **C3b — KILLED.** the same retention for an extractor (trafilatura 2.2.0)
- **C4 — SURVIVES.** raw markup is 10x the size of the content by token count

## Robustness: the second tokenizer

| quantity | o200k_base | cl100k_base | move |
| --- | --- | --- | --- |
| R_naive (C1) | 0.9090 | 0.9074 | 0.2 points |
| K_naive (C2) | 2.8241 | 2.8149 | 0.9 points |
| R_extract (C3a) | 0.9813 | 0.9811 | 0.0 points |
| K_extract (C3b) | 0.5861 | 0.5819 | 0.4 points |
| M (C4) | 30.3075 | 29.6775 | 2.1 % of value |

No primary median moves more than the sealed bar between the two tokenizers, so no verdict is downgraded.

## What a page looks like

Median page in the corpus, by token count:

- `T_html` **78,925 tokens** — the HTML as fetched
- `T_naive` **6,027 tokens** — html2text over the whole document
- `T_extract` **1,189 tokens** — trafilatura markdown extraction
- `T_visible` **2,158 tokens** — the visible text (nav and footer included)

Share of pages where the markup really is 10x the content or more: **85.0 %** (164 of 193). The claim's own word is "can"; on the existence reading this is the number, and the sealed rule reads it as the typical case instead.

Pages excluded because the body carried under 100 tokens of visible text — client-rendered pages, mostly: **3**.

## Worst and best

| page | T_html | T_visible | markup ratio | naive saving | extract saving | extract retention |
| --- | --- | --- | --- | --- | --- | --- |
| `cookiedatabase.org` | 464,318 | 674 | 688.9x | 99.8 % | 99.9 % | 36.6 % |
| `cookiedatabase.org` | 464,782 | 1,055 | 440.6x | 99.7 % | 99.9 % | 36.0 % |
| `cookiedatabase.org` | 464,912 | 1,143 | 406.7x | 99.6 % | 99.9 % | 41.9 % |
| `meta.com` | 198,809 | 603 | 329.7x | 99.3 % | 99.6 % | 128.0 % |
| `wired.com` | 467,487 | 1,688 | 276.9x | 98.7 % | 99.8 % | 53.4 % |
| `debian.org` | 16,660 | 5,091 | 3.3x | 37.8 % | 64.7 % | 115.4 % |
| `readthedocs.io` | 7,276 | 2,600 | 2.8x | 51.5 % | 65.1 % | 97.7 % |
| `gnu.org` | 5,265 | 1,940 | 2.7x | 38.3 % | 63.5 % | 99.0 % |
| `brave.com` | 30,363 | 11,753 | 2.6x | 56.5 % | 63.5 % | 94.2 % |
| `debian.org` | 3,923 | 1,819 | 2.2x | 36.7 % | 50.8 % | 106.0 % |

This is a measurement of token counts on one corpus with one tokenizer, not advice about a vendor.
