Paste a page's HTML source to measure how much of it is visible text and what the rest of the code is made of.
Browsers do not let one website read another site's pages, so this checker never fetches a URL. It works on the HTML you paste, which also means private or staging pages can be checked safely.
| What makes up the HTML | Size | Share |
|---|
Bands are common rules of thumb used by SEO audit tools, not a Google ranking threshold. Text is what a visitor can read in the body; scripts, styles, inline SVG and hidden templates are excluded.
This text to HTML ratio checker measures how much of a web page's source code is text a visitor can actually read, and shows what the rest of the code is made of. It is built for site owners, developers and SEOs auditing heavy templates, and it counts the elements in the body against the thresholds Lighthouse uses for excessive DOM size, so you can see whether bloated markup is likely to slow the page down.
Quick answer: the text to HTML ratio is the size of a page's visible text divided by the size of its full HTML, times 100. Paste the page source into the text to HTML ratio checker: under 10% is low, 10 to 25% is typical for templated sites, and 25 to 70% is content rich. No ratio is a Google ranking rule.

In This Guide
What Is the Text to HTML Ratio?
The text to HTML ratio, also called the code to text ratio, is the percentage of a page's HTML file size that is readable body text rather than tags, attributes, scripts and styles. It is a quick health check for code bloat, not a measure of content quality.
The formula in plain words: ratio equals visible text bytes divided by total HTML bytes, multiplied by 100. Both sides are measured in UTF-8 bytes, so a £ sign or an accented letter counts the way it does on the wire. This checker parses the HTML the way a browser does, removes script, style, noscript, template, SVG, iframe and canvas content, then reads the text left in the body. Repeated spaces and line breaks are collapsed by default, because indentation is not content; the band line also shows the figure with whitespace counted, which is how some older tools report it.
How to Use the Text to HTML Ratio Checker
Step 1: Paste the Page Source
Open the page, press Ctrl+U (Cmd+Option+U on a Mac) to view the source, select all and paste it in. Browsers stop one website reading another's pages, so this tool never pretends to fetch a URL. For sites built with JavaScript frameworks, copy the rendered HTML from the browser's developer tools instead, because the raw source may hold almost no text.

Step 2: Choose the Text Options
Keep Collapse repeated spaces ticked for a fair figure. Tick Count image alt text if you want image descriptions included, which suits product and gallery pages where alt text carries real information.

Step 3: Read the Ratio and Band
The large figure is your ratio, with its band, the HTML size, the text size, the word count and the number of elements in the body. The verdict names the biggest source of code on the page and the most useful fix for it.

Step 4: Check the Code Breakdown
The table splits the file into visible text, scripts, style blocks, inline SVG, comments and other markup, each with its size and share. Work on the biggest row first, then paste the new source to compare.

What Is a Good Text to HTML Ratio?
A text to HTML ratio of 10% or more is a sensible minimum, and 25 to 70% is common for article pages with a clean template. These are rules of thumb used by SEO audit tools: Google publishes no target figure, and a short product page can rank well at 8% if it answers the searcher.
| Ratio | Band | What it usually means |
|---|---|---|
| Under 10% | Low | Heavy inline scripts, SVG or page builder markup; check speed |
| 10 to 25% | Typical | Normal for shops, home pages and templated sites |
| 25 to 70% | Content rich | Articles and guides with lean templates |
| Over 70% | Mostly text | Very bare pages, plain text exports or missing navigation |
Compare pages of the same type rather than chasing one number. A blog post at 12% next to similar posts at 35% is worth investigating; a checkout page at 12% is not.
Does Text to HTML Ratio Affect SEO?
Not directly: Google does not list the text to HTML ratio as a ranking factor, and adding words just to raise it will not help. It matters indirectly, because bloated HTML is slower to download and render, and Google's page experience guidance says it rewards pages that load quickly and are pleasant to use, alongside helpful content.
Here is a worked example. Leah audits the home page of a bakery in Manchester. The pasted source is 412 KB but only 9 KB is visible text, a ratio of 2.2%. The breakdown shows 180 KB of inline SVG icons and 140 KB of inline scripts from old tracking tags. She swaps the icons for one cached sprite file and removes two unused trackers, which cuts the HTML to 96 KB. The text is still 9 KB, so the ratio rises to 9.4%, and the page now downloads more than four times less HTML on every visit.
How Do I Improve a Low Text to HTML Ratio?
Cut code before you add words. The fastest wins are usually moving inline scripts and styles into cached external files, replacing repeated inline SVG icons, and removing unused plugins that inject markup on every page.
- Move inline JavaScript and large style blocks into external files the browser can cache.
- Load repeated SVG icons from one sprite file rather than pasting them into the HTML.
- Remove tracking tags and plugins you no longer use.
- Simplify page builder sections that wrap each element in several extra divs.
- Minify the HTML to strip comments and indentation.
- Add genuinely useful text where a page is thin, such as sizing details or answers to common questions.
When you do add text, check it reads naturally with the keyword density checker rather than repeating one phrase, and keep the most important words in the title and description you set with the meta tag generator. Bands and thresholds checked October 2026.
Terms Behind the Text to HTML Ratio Checker
These terms explain what the text to HTML ratio checker measures, helping you read each part of the code breakdown and decide which markup to trim first.
- Visible text
- The words a visitor can actually read in the rendered body of a page. Content inside script, style, template and similar elements is not displayed, so it is excluded before the text size is compared with the full file.
- Document Object Model
- The tree of nodes a browser builds after parsing HTML, with each element, attribute and piece of text as an object. A very large number of body elements makes this tree slow to style, lay out and update.
- UTF-8
- The standard character encoding for the web, which stores each character in one to four bytes. Plain English letters take one byte, while symbols such as the pound sign or accented letters take more, which affects byte-based size measurements.
- Inline SVG
- Vector graphics written directly into the HTML as svg markup instead of being loaded as a separate image file. Icons and illustrations stored this way can add many kilobytes of path data that a reader never sees as text.
- Rendered HTML
- The markup that exists after a browser has run the page's JavaScript and inserted dynamic content. On sites built with client-side frameworks it can differ greatly from the raw source returned by the server.
- Code bloat
- Markup, scripts and styles that are larger than a page needs, often produced by page builders, unused libraries or repeated wrapper elements. It increases download and parsing time without adding anything readable for visitors.
</>Embed this calculator on your website
Add the free Text to HTML Ratio Checker to your own site or blog. Copy the code below and paste it into an HTML block. It resizes itself and works on phones.
How we checked this tool: Zahid Awais built this tool, checked it against the official rules or published standards where they apply, and tested it against worked examples. Results are estimates for planning, not personal financial or tax advice. Read our editorial policy and disclaimer, or report an error.
Frequently Asked Questions
How is the text to HTML ratio calculated?
Divide the size of the page's visible text by the size of its full HTML source, then multiply by 100. For example, 9 KB of text in a 96 KB HTML file gives a text to HTML ratio of 9.4%.
Is text to HTML ratio a Google ranking factor?
No. Google does not list the text to HTML ratio as a ranking factor or publish a target. A low ratio is only worth fixing when the extra code makes the page slower or hides thin content.
Why can't this tool check a URL directly?
Browsers block one website from reading another site's pages, a security rule called the same origin policy. Paste the page source instead: press Ctrl+U on the page, select all, copy and paste it into the checker.
Why is my ratio so low on a WordPress site?
Page builders, inline SVG icons, inline CSS and tracking scripts often add hundreds of kilobytes of code to every page. The breakdown table shows which of these takes the largest share so you can tackle it first.
Does image alt text count as text?
Not by default, because alt text is not shown on screen. Tick the alt text option to include it, which gives a fairer ratio for galleries and product pages where alt descriptions carry real information.
What is the difference between text to HTML and code to text ratio?
They are the same measure under two names. Both compare the size of a page's readable text with the size of its full HTML source and express the result as a percentage.