Code to Text Ratio Checker

Paste one or more pages and see what share of each is readable text, how much is inline code and markup, whether text is hidden, and how much is menus and footers.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Paste a page

    Paste the page source into the box, or open HTML files from your computer.

  2. 2
    Read the bar

    Check the text share and which kind of code takes the most bytes.

  3. 3
    Check hidden text

    Read the hidden text samples and decide whether each one is legitimate.

  4. 4
    Read the advice

    Work through the findings on inline code, thin content and boilerplate.

  5. 5
    Add more pages

    Add other templates with the plus button or open several files at once.

  6. 6
    Compare and export

    Open Compare pages and export the CSV for your template review.

About this tool

A code to text ratio compares the bytes a visitor can read with the bytes of everything else in the HTML. Search engines do not rank pages by this number, but it is a quick health check for templates. A very low ratio usually means the page carries heavy inline scripts, large framework state blobs, inline CSS or deep wrapper markup, all of which slow the first load. A page with plenty of markup and very few words may simply be thin. This checker goes further than one percentage. It splits the page into visible text, tags and attributes, inline scripts, JSON-LD structured data, inline CSS including style attributes, comments and hidden text, and draws them as one bar. It counts visible words, separates main content inside main or article from boilerplate in headers, navigation, sidebars and footers, and reports screen-reader-only text separately. Hidden text is anything inside elements with the hidden attribute or styles such as display:none, visibility:hidden, a zero font size or a large negative text indent, with samples so you can judge it.

Reading the numbers

Most content pages fall between 10 and 30 percent text. Below 10 percent, look at the bar: if inline scripts dominate, a framework may be embedding the whole data store in the page; if markup dominates, components are nesting too deeply. A main content share under half means navigation and footer links outweigh the article, which is common on short pages with mega menus.

Hidden text

Hidden content is not always a problem. Tabs, accordions and mobile menus hide text that visitors can open. Text that no visitor can ever see, such as a block of keywords set to display:none, breaks Google's spam policies. The samples show the first words of each hidden block so you can tell the two apart.

Comparing pages

Add pages with the plus button or open several HTML files at once. The compare tab lists size, text share, words, inline JavaScript and CSS, hidden words and main share for each page, so a template that drifts from the others stands out. The CSV export holds the same columns plus raw byte counts.

Limits

The checker reads the HTML as sent and does not run scripts, so text added by JavaScript is not counted, and inline styles from stylesheets cannot be seen; only hidden states in style attributes and the hidden attribute are detected. Bytes are UTF-8 sizes of the source, before compression. The result is a diagnostic, not a ranking score or official guidance.

Worked example

The sample guide page is 1,262 bytes. Visible text is 437 bytes, so the ratio is 34.6 percent, with 83 visible words. Inline state script takes 147 bytes, JSON-LD 76, inline CSS 110 plus 20 bytes of style attributes, comments 25 and tags and attributes 420. A display:none block hides 8 words of keyword stuffing, cheap shoes best shoes buy shoes discount shoes, which the tool lists as hidden text to remove. Main content is 86.5 percent of the visible text, and the 23 bytes of sr-only text are noted as fine. The advice flags the page as thin at 83 words.

Quick facts

Frequently asked questions

Is text to HTML ratio a Google ranking factor?

No. Google has said it does not use it. It is useful because the things that lower it, like bloated templates and thin content, do affect speed and quality.

What ratio should I aim for?

There is no target. Compare similar pages on your site and investigate outliers rather than chasing a number.

Does screen-reader-only text count as hidden?

No. Text in classes such as sr-only or visually-hidden helps assistive technology and is counted as visible, with its size shown separately.

Why is JSON-LD separate from scripts?

Structured data is useful content for search engines, so it is shown on its own instead of being lumped in with application code.

Can I check pages built with JavaScript?

Copy the rendered outerHTML from DevTools instead of view source. Then the text added by scripts is included.

Is my HTML uploaded?

No. Everything runs in your browser; the pages are kept in local storage so undo and the page list survive a reload.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages