Type a tool name, for example "keyword density" or "transcript".
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.
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.
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.
You only need a public page address to run the check, and the result appears in a few seconds. Follow these steps:
https://example.com. If you leave off the protocol, the tool adds https:// for you.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.
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.
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.
| Band | Ratio | What to do |
|---|---|---|
| Low | Below about 15% | Add real content and trim code |
| Fair | About 15% to 24% | Move inline code out, expand thin sections |
| Good | 25% to 70% | No action needed |
| Text-heavy | 70% and above | Confirm the markup loaded correctly |
A low ratio means the file contains much more code than words. Start with the biggest sources of weight:
style and script blocks into external files that browsers can cache.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.
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.
This tool helps anyone who needs a fast read on how content-rich a page's HTML is. Common situations include:
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.
A few habits make the numbers far more reliable and more useful.
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.
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.
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.
https://www.example.com/page. Addresses with usernames or passwords are not accepted.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.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market