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
- Enter the URL of a public page or paste its HTML source.
- The tool strips scripts, styles and comments, extracts the visible text and compares its byte size with the full HTML.
- 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.
Related tools
- Word CounterPaste or type a text to get its word, sentence and paragraph count, along with an estimate of its reading time.Free · runs in your browser
- Meta Tag AnalyzerPaste a page's HTML or enter its URL to list every meta tag in one table and spot the ones that are missing or off.Free · no account needed
- PageSpeed and Lighthouse AuditEnter a URL and choose mobile or desktop: the tool queries Google's PageSpeed Insights API and clearly separates the lab test from real-user data.Free account · 3 live checks/day
- Single Page SEO AuditEnter a page address: the tool downloads it, runs about fifty technical checks and returns a score per category with the issues to fix first.Free account · 3 live checks/day
- Reading Time CalculatorPaste an article to estimate how long it takes to read, or to say aloud, with a speed you can adjust for each language.Free · runs in your browser
- Lazy Loading CheckerCheck that lazy loading is used in the right places: below the fold, never on the main image, with the right attributes.Free · runs in your browser