Tool · Last verified 2026-08-23

HTML → Markdown Token Savings

Raw HTML bills you for navigation, footers, class names, inline styles and tracking scripts — none of which the model needed. Converting to Markdown removes 47%–68% of input tokens on the four page types measured below; dropping to plain text removes 56%–74%. Paste a page and price the difference on all eight tracked models.

Calculator

Paste HTML, price the difference

Runs entirely in your browser. Markdown mode keeps headings, lists, emphasis and link targets; plain-text mode drops everything including hrefs.

Raw HTML from a page, email or scrape
0raw HTML tokens
0converted tokens
0tokens removed
of input saved
Sample pages:
Cheapest per 1,000 requests after cleaning
Most expensive per 1,000 requests, raw HTML
ModelRaw HTML / 1,000 requestsConverted / 1,000 requestsSaved / 1,000 requestsSaved / 100,000 requests
Input only: output is unchanged by cleaning, so only the input side of the bill moves. Private: no upload, no network request. Pricing data verified —
Measured

Four page types, before and after

Token counts from this site's estimator on representative samples loaded by the preset buttons above. Percentages are share of input tokens removed.

Page typeHTML charactersRaw tokensMarkdown tokensSavedPlain-text tokensSaved
Blog article
Nav, header, article, related links, footer
2,10855128448.5%22060.1%
API docs page
Sidebar, params table, code blocks, error list
2,36164634047.4%28456.0%
Product detail page
Breadcrumbs, gallery, specs table, reviews
2,95280025767.9%20674.3%
Marketing landing page
Hero, feature grid, logo strip, footer columns
3,20687131663.7%22873.8%

Measured with the heuristic estimator used across this site, not with a provider tokenizer — real counts differ by a few percent in either direction. These numbers sit inside the 30–60% rule of thumb quoted elsewhere on GetMoreTokens and above it at the top end, because product and marketing pages carry far more boilerplate than article pages. Your own markup may save less if it is already lean, or more if it ships a framework shell.

Where it goes

What you were paying for

On a typical scraped page the actual prose is a minority of the tokens. The rest is scaffolding that costs the same per token as the content you wanted.

Markup is billed at content rates. Every <div class="...">, every repeated href, every aria-label and every nested wrapper consumes tokens at the same price as a sentence of the article.

Boilerplate repeats on every fetch. Navigation, footers, cookie banners and "related posts" blocks are identical across thousands of pages, and if you crawl a site you pay for them thousands of times.

Scripts and styles are the worst offenders. A tracking snippet or a minified CSS block is dense, meaningless text that tokenizers expand aggressively. Strip <script>, <style>, <svg> and JSON-LD before anything else.

And the saving compounds with the expensive model. On the blog-article sample, cleaning saves $5.34 per 100,000 requests on GPT-5.6 Luna but $133.50 on Claude Opus 5 — same tokens, 25x the money, because the percentage saving applies to a higher rate.

Tags and attributesClass names, IDs, data attributes and ARIA labels are billed like words.
Script and style blocksDense, meaningless, and often a quarter of a page's tokens on framework-built sites.
Navigation and footersIdentical on every page of a site — paid for on every page of a crawl.
Pretty-printed JSON-LDStructured data in <head> is pure overhead unless the task needs it.
Whitespace and entitiesIndentation and &nbsp; style entities are cheap individually, countless in aggregate.
Caveats

When cleaning costs you accuracy

Stripping markup is not universally right. Three cases where it backfires.

The task is about the markup. "Which button sits above the fold", "what CSS classes are used for pricing", "extract every outbound link" — all of these need the DOM. Keep the structure, or send a targeted slice instead of the whole page.

Tables lose their shape. Converting a complex table to Markdown can scramble column alignment on merged cells. If the answer depends on row/column relationships, keep the table in a pipe format you control, or send the table alone.

Link targets carry the answer. Plain-text mode removes hrefs entirely. If the question is "where does this page point", use Markdown mode or keep a separate list of URLs.

For everything else — summarisation, classification, extraction, RAG over documentation — the cleaned version is both cheaper and more accurate, because the model stops competing with navigation text for attention. Check that the result still fits where you need it with the Context Window Checker.

Keep Markdown whenHeadings, lists, emphasis or link targets matter to the answer.
Use plain text whenThe task is extraction, classification or embedding and structure is noise.
Never strip for DOM tasksLayout, class names, visual order and outbound link extraction need the markup.
Measure, don't assumeRun your own page through this tool — a lean page may save only 20%.
FAQ

HTML token savings questions

How many tokens does converting HTML to Markdown save?

On four representative page types measured with this site's estimator, converting raw HTML to Markdown removes 47.4% to 67.9% of input tokens: 48.5% on a blog article, 47.4% on an API docs page, 67.9% on a product detail page and 63.7% on a marketing landing page. Dropping to plain text and discarding link targets removes 56.0% to 74.3%.

Is plain text cheaper than Markdown?

Yes, by roughly 8 to 12 percentage points on the page types measured here, because plain text also discards link URLs. Use Markdown when the model needs structure such as headings, lists and link targets; use plain text when the task is extraction or classification and the links are noise.

Does cleaning HTML change answer quality?

It usually improves it. Navigation, footers, tracking scripts and inline styles are filler that competes for attention inside the context window, and removing them tends to raise retrieval precision. It hurts when the task depends on markup itself — DOM position, CSS class names, exact table layout, or extracting hrefs you just deleted.

Does this tool upload my HTML?

No. The conversion and the token estimate run entirely in your browser. This page has no form, no backend endpoint, no analytics script and no network requests — paste proprietary markup without it leaving the tab.

Does the saving apply to output tokens too?

No. Cleaning HTML only reduces input tokens, because the reply is generated the same way either way. On a pipeline that reads 3,000 tokens and writes 400, the saving applies to the larger side of the bill — which is exactly the side that scales with the number of documents you process.

Methodology

How these numbers are produced.

The conversion removes <script>, <style>, <noscript>, <svg>, <head> and comments, decodes common HTML entities, then either drops all remaining tags (plain-text mode) or maps headings, emphasis, lists and links to Markdown before dropping the rest. Token counts come from the same heuristic estimator used across this site, which weights CJK characters, emoji, punctuation, whitespace and Latin characters separately — it is a cross-model approximation, not provider tokenizer output, so real counts differ by a few percent.

Cost figures multiply token counts by published per-1M input rates, with OpenAI's long-context surcharge applied automatically above 272,000 input tokens. Output tokens are unaffected by cleaning and are excluded. Caching, batch, tool use and taxes are excluded throughout. Rates: OpenAI, Anthropic, Google — verified weekly.

Count any textCharacters, words, tokens and per-model input cost: Token Counter.
Price a workloadTurn token volumes into monthly spend: API Cost Calculator.
Check it still fitsContext Window Checker — windows and output caps for all 8 models.
What a token isDefinition, conversion by content type, and why output costs 5–8x input: What Is an AI Token?
Tokens per content typeHow Many Tokens in 1,000 Words?
Provider rate cardsOpenAI · Claude · Gemini · all three.
1M tokens in words750,000 words, 1,500 pages — and why only 5 of 8 models accept it in one request: How Many Words Is 1M Tokens?
Trim the promptFind repeated instructions, markup and filler: Prompt Weight Analyzer