Skip to content
Rankora
Free · no account needed

Text-to-HTML Ratio Calculator

Paste a page's HTML or enter its URL to measure how much of the code is readable text and how heavy the inline scripts and styles are.

Privacy and cost

This tool requests the public URL you enter from our servers. It is free, rate-limited to prevent abuse, and we do not store the URL or the page content.

How it works

  1. Enter the URL of a public page or paste its HTML source.
  2. The tool strips scripts, styles and comments, extracts the visible text and compares its byte size with the full HTML.
  3. You get the ratio, both sizes, the word count and the weight of inline scripts and styles.

Example

Test page with 455 bytes of HTML, 133 of them visible text: a 29.2% ratio. It holds one inline script of 80 bytes and one style block of 69 bytes.

What the result means

The text-to-HTML ratio compares the size of the visible text with the size of all the page code. A very low ratio means a lot of markup, scripts or styles compared with content. Google has not confirmed it as a ranking factor: it is a practical indicator of unnecessary code. The 10% and 25% marks are rules of thumb.

Common problems this tool helps with

  • Heavy inline scripts and styles bloat the HTML without adding content.
  • A theme that outputs layers of nested divs buries the text in markup.
  • Forgotten HTML comments are shipped to every visitor.
  • A page with almost no visible text, filled in by JavaScript, looks empty in the raw HTML.

Frequently asked questions

What text-to-HTML ratio should I aim for?

There is no official value. Below roughly 10% the page is mostly code, from 25% it is common for a content page. A tool or gallery page can legitimately sit lower.

Does the ratio affect Google rankings?

Google has not confirmed the ratio as a ranking factor. It mainly helps you spot heavy code, which slows loading.

How is the visible text calculated?

We read the body text, ignoring scripts, styles, comments and elements marked hidden. Size is counted in UTF-8 bytes.