CrawlCheck

Agent view · Guides · 2026-10-02

Text-to-HTML ratio: does it matter, and how to check it

This is the response this server returns to a client that asks for Accept: text/markdown at https://crawlcheck.io/guides/text-to-html-ratio-when-a-page-is-mostly-code: fetched when you opened this page, shown byte for byte. An assistant, a crawler that negotiates markdown, or anything reading our feed gets exactly this. The markdown leaves signed (RFC 9421, key in our key directory), so a crawler can prove the page it read is the page this server sent; the check is shown below.

status200
content-typetext/markdown; charset=utf-8
varyAccept
link<https://crawlcheck.io/llms.txt>; rel="describedby"; type="text/plain", <https://crawlcheck.io/.well-known/api-catalog>; rel="service-desc"; type="application/linkset+json", <https://crawlcheck.io/guides/text-to-html-ratio-when-a-page-is-mostly-code>; rel="cite-as", <https://crawlcheck.io/.well-known/http-message-signatures-directory>; rel="http-message-signatures-directory"
cache-controlpublic, max-age=900, stale-while-revalidate=2400
bytes16,791
words2,509
sha-256a3cc518602d8c98c46de1d73050456fd78c6cc70975dfcb289a12724b0bf260e
repr-digestsha-256=:o8xRhgLYyYxG3h1zBQRW/XjGzHCXXfyyiaEnJLC/Jg4=: ← matches the body shown
signature-inputsig1=("@authority";req "@path";req "repr-digest" "content-type");created=1795311481;expires=1795315081;keyid="1hHmE3fo1rg5Ig70wuFtJ5wBc7G-sUTgUJkxyPWFRps";alg="ed25519";nonce="oB2pSRr2trdzHJezVIfRkA";tag="crawlcheck-page"
signaturesig1=:8u/Uikhap43JubYLJrIqkxp2IyMEubgAboEG0gMIHE4PoRx9GDLMtpAC8iEbAZWPoZlftx2vw9eR7jx3p0lRDw==:
verifiedyes — signature by key 1hHmE3fo1rg5Ig70… from https://crawlcheck.io/.well-known/http-message-signatures-directory (directory valid), valid for 3600 more s. Checked here exactly as a crawler would; redo it yourself: https://crawlcheck.io/api/tool/wba
Guides · 2026-10-02 · By [VSNARY | Emmanuel Orta](/author) · 1 view

# Text-to-HTML ratio: does it matter, and how to check it

Not a ranking factor, but on a large page under five percent text, crawlers and AI agents download CSS, scripts and state before a sentence, and pay for it in tokens. Two commands to measure it and the block to remove first.

Text-to-HTML ratio is the share of a page's decompressed HTML bytes that is visible text. Google has said it is not a ranking signal, but it still matters to crawlers and AI agents with byte and token budgets: on a page that is 3 percent text, 97 percent of what they read is inline CSS, scripts, JSON state and SVG. Judge it on large pages only (over about 50 KB decompressed). Under 5 percent is unusual, and the fix starts with the single largest block, which is usually far bigger than the next.

Check your own site free

Check my site

About a minute. First scan free with your email, nothing installed.

On this page

- What does the ratio measure?
- Is there a good ratio?
- What does a mostly-code page cost an AI agent?
- How do I measure it myself?
- What to remove first
- Measured on a site we run
- What the ratio does not say

Text-to-HTML ratio earned its bad reputation: Google has said it does not use the ratio as a ranking signal, and tools that turned it into a target percentage invented a rule. The measurement underneath is still useful, for a different reason. Every machine that reads a page pays for bytes, and AI agents pay for tokens. A page whose visible words are a few percent of its HTML makes every reader download a framework before it reaches a sentence.
Where the bytes of a large homepage typically go. Only the outlined sliver is text a reader, or a model quoting the page, can use.

## What does the ratio measure? #

Take the HTML exactly as the server sends it, decompress it, and count the bytes. Then extract the text a person would see, excluding scripts, styles, templates and hidden elements, and count those bytes. The ratio is the second over the first. Use decompressed bytes: CSS and JSON compress very well, so compressed sizes flatter repetitive markup, and the decompressed size is what a parser walks and a tokenizer consumes.

Size and share have to be read together. A 6 KB page that is 3 percent text is a short page with a nav bar, and there is nothing to fix. A 400 KB page that is 3 percent text is carrying serialized application state, an inlined stylesheet and an icon set before its first paragraph.

## Is there a good ratio? #

No target, only a floor. Under 5 percent on a large page is plainly unusual; a page at 6 percent is not healthy because it cleared the line, and on a small page the ratio means nothing. A large page that is mostly code turns up on 28.4% of scanned sites, which makes it one of the most common delivery problems we see.

## What does a mostly-code page cost an AI agent? #

An agent that hands a model the raw HTML pays for every tag, attribute, script and style block; one that extracts the text first pays only for the words. At roughly four characters of English per [token](/glossary/token), here is what two homepages cost to read on the same day:

| Homepage, 18 October 2026 | Read as HTML | Read as text | Text share |
| --- | --- | --- | --- |
| A national news site | ~111,600 tokens | ~3,100 tokens | 3% |
| crawlcheck.io | ~12,400 tokens | ~1,900 tokens | 15% |

On the news homepage, 97 of every 100 tokens an agent read as HTML were markup, scripts and styles. Our own homepage is far smaller and still 85 percent markup. A model's [context window](/glossary/context-window) is fixed, so a page that spends most of its tokens on wrapper either crowds out the content, gets truncated, or costs more per question, and an agent comparing ten sources pays that ten times. Answer engines that fetch at the moment a user asks often work under time and size limits too, so a page that front-loads its styles and state can be cut off before the text that answers the question.

If the words only appear after JavaScript runs, the problem is larger: a non-rendering agent pays the full HTML cost and still sees almost no text. That is covered in [whether AI crawlers render JavaScript](/guides/do-ai-crawlers-render-javascript). Serving a markdown version on request gives agents that ask for it roughly the text cost; [the markdown for agents guide](/guides/markdown-for-agents-serving-text-markdown-by-content-negotiation) shows how. It is a shorter road, not a replacement for a readable page.

## How do I measure it myself? #

Two commands on the HTML the server sends, not the browser's live DOM, which includes text inserted by JavaScript that a non-rendering crawler never receives:

```
# Decompressed bytes the server sends
curl -s --compressed -o page.html https://example.com/
wc -c < page.html

# Bytes of visible text: drop script, style, noscript, template, svg, comments and tags
perl -0pe 's/<(script|style|noscript|template|svg)\b.*?<\/\1>//gis; s/<!--.*?-->//gs; s/<[^>]+>//g; s/\s+/ /g' page.html | wc -c
```

Divide the second number by the first for the ratio. Divide each by four for a rough token count as HTML and as text; other languages, code and long URLs tokenize differently, so treat it as a scale, not a bill. Run it on the homepage and on your heaviest template, which is often a product listing or a location page rather than the homepage.

Then find the biggest single blocks:

```
# The largest inline blocks, biggest first
perl -0ne 'while (/<(script|style|svg)\b.*?<\/\1>/gis) { printf "%8d %s\n", length($&), $1 }' page.html | sort -rn | head
```

The first line is almost always far larger than the second: an inline stylesheet of several hundred kilobytes, a hydration script carrying every product in a category, or a mega-menu repeated in a mobile copy. Fixing that one block typically moves the ratio more than every other change combined.

## What to remove first #

| Largest block | Where it usually comes from | First fix |
| --- | --- | --- |
| inline `<style>` | page builders and critical-CSS plugins that inline everything | inline only above-the-fold rules; move the rest to a cached file |
| inline JSON state | framework hydration data (the `id="__NEXT_DATA__"` script, Nuxt, Gatsby page data) | trim the props the page does not render; paginate large lists |
| inline `<script>` | tag managers, chat widgets, consent tools pasted into the head | load from a file with `defer`; drop unused tags |
| SVG markup | icon sets inlined on every page | one sprite file referenced by `<use>`, or image files |
| data URIs | images and fonts base64-encoded into CSS or HTML | serve as files so they cache and do not inflate the page |
| repeated markup | mega-menus and footers with hundreds of links | shorten the menu; render rarely used parts on demand |

Re-measure after each change, and re-measure through the [CDN](/glossary/cdn): a cached copy of the old page keeps serving the old ratio until it is purged. [The caching guide](/guides/machine-file-caching-stale-split-and-blocked-behind-the-edge) covers how to confirm what crawlers actually receive after a change.

## Measured on a site we run #

A tree-service homepage we operate measured 7.7 percent visible text before a payload pass, with seven render-blocking stylesheets and the page builder's inline bootstrap script in the head. Merging four adjacent per-section stylesheets into one cached file, deferring the script loader, moving an inline compatibility script to a file and removing an emoji script, together with about 450 words added to an on-page guide, took it to 10.3 percent. Most of the movement came from deleting bytes that were not content. The text is rarely too short; the wrapper is too large.

## What the ratio does not say #

A high ratio does not mean the page is good, only that it is not mostly wrapper. A [parked domain](/glossary/parked-domain) with 800 words of [boilerplate](/glossary/boilerplate) has an excellent ratio, as shown in [a parking page that defeats every thin-content check](/blog/a-783-word-parking-page-defeats-every-thin-content-check). A low ratio on a homepage that is mostly navigation and images is not a defect by itself. It is a delivery and cost measurement, not a quality one.
Read live from the same counters the dataset page uses, at the moment this page was served. Bars are scaled to the largest value shown, not to 100%.

Written by

[Emmanuel Orta](/author) · VSNARY

I build CrawlCheck and write everything published here, from measurements the verification layer took. Where a post got something wrong, the correction stays in the post.

[Every post, and where I got it wrong →](/author) · [Follow on LinkedIn →](https://www.linkedin.com/in/emmanuelorta)

Share this finding: [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcrawlcheck.io%2Fguides%2Ftext-to-html-ratio-when-a-page-is-mostly-code%3Futm_source%3Dlinkedin%26utm_medium%3Dsocial%26utm_campaign%3Dshare)[X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fcrawlcheck.io%2Fguides%2Ftext-to-html-ratio-when-a-page-is-mostly-code%3Futm_source%3Dx%26utm_medium%3Dsocial%26utm_campaign%3Dshare&text=Text-to-HTML%20ratio%3A%20does%20it%20matter%2C%20and%20how%20to%20check%20it)[Email](mailto:?subject=Text-to-HTML%20ratio%3A%20does%20it%20matter%2C%20and%20how%20to%20check%20it&body=https%3A%2F%2Fcrawlcheck.io%2Fguides%2Ftext-to-html-ratio-when-a-page-is-mostly-code)[Follow Emmanuel on LinkedIn](https://www.linkedin.com/in/emmanuelorta)

## Questions this post answers

### Is text-to-HTML ratio a Google ranking factor?

No. Google has said it does not use the ratio as a ranking signal. It is still a useful measure of how much of a page's transfer is content rather than code.

### What is a good text-to-HTML ratio?

There is no target. Visible text under 5 percent on a large page is unusual enough to be worth fixing; on a small page the ratio means nothing.

### Should the ratio use compressed or decompressed bytes?

Decompressed. CSS and JSON compress very well, so compressed sizes understate how much markup a parser or tokenizer has to process.

### How do I estimate what my page costs an AI agent in tokens?

Count the decompressed bytes of the HTML and divide by about four for English text; do the same for the visible text alone. The gap is what an agent reading raw HTML pays for markup instead of words.

### What usually makes a page mostly code?

Inlined stylesheets, framework hydration state, tag-manager and widget scripts in the head, inlined SVG icon sets and base64 data URIs. One of them is usually most of the page.

### Does a high ratio mean the page is good?

No. A parked page full of boilerplate text can have a high ratio. The ratio measures delivery and reading cost, not quality.

## Related findings

[2026-10-06 State of AI visibility, October 2026: 139,788 homepages 139,788 homepages measured 3–6 October 2026: 6.3% block an AI crawler, 15.4% publish llms.txt, the median homepage is 3.6% text. L](/blog/state-of-ai-visibility-october-2026-139788-homepages)[2026-08-29 www and non-www both return 200? A canonical won't fix it If www and the bare domain both answer 200, crawlers fetch every page twice, whatever your canonical says. The one-line check and](/blog/our-canonical-was-right-and-the-site-was-still-served-twice)[2026-09-25 How to test text color contrast on hover and keyboard focus Our hover and focus sweep found 65 contrast failure patterns a static check missed. Six steps to test WCAG contrast on hover, focu](/guides/how-to-test-color-contrast-in-hover-and-focus-states)

The main product

Found this on your own site? **We fix it for $100.**

Scan free to see where you stand. The fix is one site, every finding implemented and re-measured, with a sealed before and after.

[Fix it all — $100](https://buy.stripe.com/4gM00j7OjawhdLEdyR2VG0v)
[What it covers](/pricing#fix) · [scan first, it is free](/)

Free browser extension

Check this on any site you open, **without leaving the page.**

CrawlCheck for Chrome grades every site you visit A–F and shows, from your own browser, what search engines and AI assistants are actually served. Free, no account.

[Add to Chrome — free](https://chromewebstore.google.com/detail/plgjengobhbdmbgckiiaaflgiepdbcpi?utm_source=crawlcheck.io&utm_medium=post)
[What it does](/extension)

Write for the library

Measured something yourself? **Submit an article.**

Send your finding, the data and the method. A person reads every submission and replies by email; accepted articles are published under your name with a link to your study. Free to submit. Articles are accepted on merit; no one can pay to have one published.

[Submit an article](/submit-finding#send)
[How it works](/submit-finding) · a reply within about a week

Spotted a mistake or a bug on this page? [Report an error](/report-error?k=article). Confirmed errors are fixed and logged on the [corrections page](/corrections).

## Comments

Comments are read before they appear. Nothing is published automatically, and no account is needed. An AI agent with a published signing key can post without the queue: it signs the request and the signature is checked against its own domain ([how](/api/comment/signed)). Those appear at once, marked *verified*.

Send for review

Writing about this? [Facts, live figures and marks](/press) — every number on that page is dated and traceable to a scan.

[All guides](/guides) · [The dataset](/data) · [How the dataset works](/policy)

We read your site the way crawlers do, from our own network, and every report says exactly what was asked for and what came back. [Who runs this](/author) · [Press kit](/press) · [Videos](/videos) · [Evidence for disputes](/evidence) · [YouTube](https://www.youtube.com/@crawlcheck) · [hello@crawlcheck.io](mailto:hello@crawlcheck.io)

#### How we measure, and our own machine files

CrawlCheck reads every site as itself. Its crawler-identity tests send named user-agent strings from its own network, never from an operator’s published range, so a site that verifies crawlers can tell them apart; every report says so. Results reflect what an anonymous non-browser client receives. [What we collect and how to opt out](/policy) · [how every report is timestamped](/proof) · [who runs this](/author) · [press kit](/press) · [hello@crawlcheck.io](mailto:hello@crawlcheck.io).

**Second vantage:** the [browser extension](/extension) measures what crawlers are served from your own address and after your JavaScript runs — the half this server cannot see. From 1.0.0 it sends the domain you ask about, on one button, and anonymous usage counts you can switch off; from 1.0.3 a footer switch turns off the hostname lookup for the grade on the icon; from 1.0.4 a share switch, on by default, sends a signed Two-vantages reading (status, size, words and a hash per identity; never page text); from 1.0.16 chips send the hostnames of search results and AI citations while the chips and grade switches are on; from 1.0.17 a readings switch, on by default, sends one signed page reading a day (numbers, the hostname and the page address with the query removed; never in incognito; at most 40 a day) and only while the share and grade switches are also on. Earlier versions send nothing.

**Our own machine layer for the agentic web:** [llms.txt](/llms.txt) · [llms-full.txt](/llms-full.txt) · [agents.md](/agents.md) · [SKILL.md](/SKILL.md) · [entitymap.json](/entitymap.json) · [media kit](/.well-known/media-kit.json) · [MCP server card](/.well-known/mcp/server-card.json) · [API catalog](/.well-known/api-catalog) · [OpenAPI](/openapi.json) · [robots.txt](/robots.txt) · [sitemap.xml](/sitemap.xml) · [security.txt](/.well-known/security.txt) — every one named in robots.txt, which is exactly what we check for on yours.

**Pages:** [IP ranges](/data/ip-ranges) · [Keys](/keys) · [/](/) · [Listing check](/listing-check) · [Conduct: Google inspectiontool](/agents/conduct/google-inspectiontool) | **Blog:** [Google's Googlebot check passes 198 of 200 rented servers](/blog/googles-googlebot-verification-rule-passes-any-google-cloud-server) | **Glossary:** [training data](/glossary/training-data) · [Retrieval precision](/glossary/retrieval-precision) · [Canonical RDF](/glossary/canonical-rdf) · [MCP resource](/glossary/mcp-resource) · [inclusion proof](/glossary/inclusion-proof) · [Content-Language header](/glossary/content-language)

[Contact](/contact) · [Partnerships](/partnerships) · [Terms of service](/terms) · [Refund policy](/refunds) · [Trust center](/trust) · [Subprocessors](/subprocessors) · [Changelog](/changelog) · [Report an error](/report-error)

Same body as a file: /guides/text-to-html-ratio-when-a-page-is-mostly-code.md · as data: /feed.json · what we tell agents site-wide: /llms.txt, /agents.md. To see any other site this way, from your own browser, after its JavaScript runs: the browser extension.