Code to Text Ratio Checker: Free HTML Test

Code to Text Ratio

Enter a URL

This code to text ratio checker measures how much of a webpage's HTML is readable text and how much is markup, scripts and styles. Enter a URL and you get a percentage, a Low, Fair, Good or Text-heavy rating, and byte counts for the text and the full HTML. It is built for SEOs, developers and site owners who want to spot thin or bloated pages quickly.

What Is Code to Text Ratio?

Code to text ratio (also called text to code ratio or content to code ratio) is the share of a page's HTML file that is human-readable text, shown as a percentage. A page with a 20% ratio is 20% visible words and 80% tags, inline styles, scripts and other code.

The calculation is simple: the size of the text left after removing code, divided by the size of the whole HTML response, multiplied by 100. This tool removes script blocks, style blocks and HTML tags, strips line breaks and tabs, collapses repeated spaces, and then compares the byte size of what remains with the original HTML size.

Why the ratio matters

The ratio is a quick diagnostic, not a score Google assigns. Google's Search Central documentation does not list code to text ratio as a ranking factor. What the number does reveal is useful: a very low ratio often means a page has little real content, heavy inline code, or a template that buries a few sentences under thousands of lines of markup. Those are real problems for crawling efficiency, page speed and content quality.

How to Use the Code to Text Ratio Checker

You only need a public page address to run the check, and the result appears in a few seconds. Follow these steps:

  1. Type or paste the full page address into the field that shows the placeholder https://example.com. If you leave off the protocol, the tool adds https:// for you.
  2. Click the button under the field to start the analysis.
  3. Check the "Fetched response" line first. It shows the address that was retrieved, the HTTP status code and the size of the response in bytes.
  4. Read the Code-to-Text Ratio Meter. It shows your percentage on a 0 to 100% scale with a status badge: Low, Fair, Good or Text-heavy.
  5. Compare the two byte counts: the size of the extracted text and the size of the full HTML.
  6. Read the recommendation box, make your changes, then run the same URL again to see the new number.

What Is the Ideal Text to Code Ratio for a Web Page?

Most SEO guides treat a ratio of about 25% to 70% as healthy, and this tool uses that range for its Good rating. Many pages that rank well sit between 15% and 30%, so use the number as a guide rather than a pass or fail grade.

Page type matters. A long article often lands above 30% because it is mostly paragraphs. An online store category page, a web app or a page with large navigation menus will often come in lower because the markup is naturally heavy. Compare a page with similar pages on your own site, not with a different kind of page.

Worked Example: Reading a Real Result

Say you check a 700-word service page. The tool reports a total HTML size of 80,000 bytes and an extracted text size of 14,400 bytes.

The math is 14,400 divided by 80,000, which equals 0.18, so the ratio is 18%. That falls in the Fair band. The page has real content, but code makes up 82% of the file.

You open the page source and find a large block of inline CSS, three inline scripts and a long set of repeated menu links. You move the CSS and scripts into external files, cut duplicate markup and add a 300-word FAQ section. On the next check the HTML is 62,000 bytes and the text is 17,500 bytes. That gives 28.2%, which lands in the Good band. The page is also lighter to download, which helps users on slow connections.

How to Read and Act on Your Results

Each rating points to a different next step, so match your result to the right fix. The table below summarizes the bands this tool shows.

BandRatioWhat to do
LowBelow about 15%Add real content and trim code
FairAbout 15% to 24%Move inline code out, expand thin sections
Good25% to 70%No action needed
Text-heavy70% and aboveConfirm the markup loaded correctly

If your result is Low or Fair

A low ratio means the file contains much more code than words. Start with the biggest sources of weight:

  • Move large inline style and script blocks into external files that browsers can cache.
  • Remove unused page-builder wrappers, empty containers and deeply nested divs.
  • Replace repeated mega-menus or footers that list hundreds of links with shorter versions.
  • Add useful text such as an introduction, a comparison, FAQs or step-by-step explanations. Do not add filler just to move the number.

If your result is Good

A Good rating means your page has a healthy balance of text and markup. Your time is better spent on content quality, internal links and page speed than on pushing the number higher.

If your result is Text-heavy

A ratio above 70% usually means a plain document with little structure, such as a text dump with almost no headings or styling. It can also mean the page returned an error message or a stripped-down version of itself. Check the HTTP status and byte size in the "Fetched response" line to rule this out.

Who Should Use This Tool?

This tool helps anyone who needs a fast read on how content-rich a page's HTML is. Common situations include:

  • SEO audits: scan key landing pages and flag the ones with the lowest ratios for a content review.
  • Thin content checks: a page with a 5% ratio and only a few sentences of text is a strong candidate for expansion or consolidation.
  • Redesigns and migrations: compare the ratio before and after a theme change to see whether the new template added heavy markup.
  • Developer reviews: catch inline scripts and styles that should live in separate files.
  • Competitor-style benchmarking of your own pages: compare templates across your site, such as blog posts against product pages.

For a wider technical review, pair this check with the GZIP compression checker to see whether your HTML is compressed in transit, and use the bulk HTTP status checker to confirm your pages return the right response codes. You can find more checks in the Website Audit and Performance tools.

Best Practices and Troubleshooting Tips

A few habits make the numbers far more reliable and more useful.

Test the exact URL you care about

Enter the final, canonical version of the page, including the correct protocol and any www prefix. If the address redirects, the tool analyzes the page it ends up on, and the fetched address in the result tells you which one that was. If you are unsure which version is canonical, run the canonical tag checker first.

Compare like with like

Check several pages built from the same template and look at the average. One outlier tells you more than one isolated score. A blog post at 12% when the rest of your posts sit near 30% is worth investigating.

Fix content before code when pages are thin

If a page has only 80 words, cleaning up the markup will not rescue it. Add information that answers the searcher's question, then trim code. For a deeper review of content trust signals, try the E-E-A-T checker.

Common problems and fixes

  • "Please enter a valid URL" type errors: remove spaces, check for typos and use a full address such as https://www.example.com/page. Addresses with usernames or passwords are not accepted.
  • No result or a fetch error: the page may be private, behind a login, blocked, or too slow to respond. The tool only works with publicly reachable http and https pages.
  • A surprisingly high or low number: look at the byte counts. A tiny HTML size suggests an error page or a redirect stub, and a huge one suggests embedded data or large inline scripts.
  • A different result after a site update: caching, A/B tests and personalization can change the HTML that is delivered. Run the check twice to confirm.

Limitations and Accuracy Notes

The ratio describes the raw HTML the tool receives, so keep these limits in mind. Pages that build most of their content with JavaScript after loading may show a lower ratio than visitors experience, because the text is not in the original HTML. The tool also measures bytes, not word counts, so a page in a language with multi-byte characters can show a higher text size than a similar English page.

Text counted by the tool is whatever remains after tags, scripts and styles are removed. That can include text inside hidden elements, so a good ratio does not prove the words are visible or useful. Images are not counted as text, so check them with the image alt text checker to make sure they add value for accessibility and image search.

Finally, treat the rating bands as widely used rules of thumb. A page with a 22% ratio and excellent content can outperform a page with a 40% ratio and shallow writing.

Ready to see where your page stands? Enter your URL in the checker on this page, review the ratio and byte counts, apply the fixes that match your band, and run it again to confirm the improvement.

Frequently Asked Questions

What is text to code ratio?
Text to code ratio is the percentage of a page's HTML file that is readable text instead of tags, scripts and styles. For example, 14,400 bytes of text in an 80,000 byte page gives 18%. This checker calculates it from any public URL.
What is the ideal text to code ratio for a web page?
A ratio of about 25% to 70% is commonly treated as healthy, and this tool rates that range as Good. Many well-performing pages sit between 15% and 30%, so compare against similar pages on your own site rather than chasing one number.
Is code to text ratio a Google ranking factor?
No. Google's Search Central documentation does not list code to text ratio as a ranking factor. The ratio is a diagnostic that can reveal thin content, bloated markup or heavy inline scripts, which can affect page quality and speed.
Why is my text to code ratio low and how do I fix it?
A low ratio means your HTML contains far more code than visible words. Move inline CSS and JavaScript into external files, remove unused wrappers and repeated menu markup, and add useful text. Then run the same URL again to compare.
Why does the checker show a different result than I expected?
The checker measures the raw HTML it retrieves from your URL, which can differ from what a browser shows after scripts run. Check the fetched address, HTTP status and byte counts in the result, then test again in case the page changed.
Is the code to text ratio checker free to use?
Yes. The code to text ratio checker is free and needs no sign-in. Enter a public page address, run the check, and you get the percentage, a Low, Fair, Good or Text-heavy rating, and the text and HTML byte counts.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now