Code to text ratio checker
See how much of a page's HTML is readable text, and where the rest of the bytes go: markup, inline JavaScript and CSS, SVG icons, base64 images and whitespace. Check a URL or paste HTML.
- Byte breakdown of the whole HTML
- Heaviest inline blocks, with line numbers
- Pasted HTML stays in your browser
Text to HTML ratio
Enter a URL to start
- HTMLWaiting for inputFetched or pasted
- Visible text—Scripts and styles left out
- Ratio—Text bytes ÷ HTML bytes
- Largest overhead—Share of the HTML
Ratio report
Enter a page URL or paste HTML above to see its code to text ratio, what fills the HTML, the heaviest inline blocks and the text that counts as content.
Fair-use limit for URL checks: 30 per hour and 200 per day for each visitor IP address. Pages and pasted HTML are read up to 5 MB.
What code to text ratio measures
The share of a page's HTML that is readable text, compared with everything else the server sends in the same file.
Text and code
Text is what a visitor reads. Code is the markup around it, plus scripts, styles, icons and data written into the HTML.
Bytes, not characters
Sizes are counted in UTF-8 bytes, as they travel over the network. An accented letter or emoji takes two to four bytes.
A diagnostic, not a score
Google does not publish a target ratio. The number is useful for spotting heavy templates and pages that hide their text behind JavaScript.
What usually fills HTML
Inline scripts from page builders and tag managers, repeated SVG icons, base64 images and deeply nested wrappers.
How the HTML is split
The eight parts the report measures, and what you can do about each.
| Part | What counts | What to do |
|---|---|---|
| Visible text | Text in the body that a visitor can read, without scripts, styles and hidden elements. | This is the "text" side of the ratio. |
| Markup | Tags and attributes: div, class, id, aria and data attributes, links to files. | Remove unused wrappers and long repeated class lists. |
| Inline JavaScript | Code inside script elements, including tracking snippets and page builder settings. | Move it into external files that browsers can cache. |
| Inline CSS | Rules inside style elements, often critical CSS or theme settings. | Keep only the critical part inline. |
| JSON | Structured data, import maps and app state such as __NEXT_DATA__. | Structured data is useful; large app state is not. |
| Inline SVG | Icons and illustrations written into the HTML. | Reuse one sprite instead of repeating icons. |
| Data URIs | Images or fonts encoded as base64 inside attributes. | Base64 is about a third larger than the file itself. |
| Comments and whitespace | HTML comments, indentation and blank lines. | Minify the HTML to remove them. |
How to use this tool
From a URL or pasted HTML to a list of what to trim.
Enter a URL or paste HTML
URLs are fetched by our server as Chrome on Android. Pasted HTML stays in your browser.
Read the ratio
Visible text in UTF-8 bytes, divided by the size of the whole HTML document.
See where the bytes go
The HTML is split into text, markup, inline code, SVG, data URIs, comments and whitespace.
Fix the heaviest blocks
The largest inline scripts, styles and images are listed with their line number.
What this tool does, and what it doesn't
A plain list, so you know exactly what to expect.
This tool does
- Measure text against the full HTML
- Split the HTML into eight parts
- List the heaviest inline blocks
- Count elements under the body
- Check pasted HTML in your browser
- Export the numbers and the text
This tool does not
- Run the page's JavaScript
- Download external CSS or scripts
- Grade the page for Google
- Judge the quality of the text
- Bypass logins or bot protection
- Store URLs or HTML
Where your data goes
For a URL, our server fetches the page as Chrome on Android and sends the HTML to your browser, where everything is measured. No copy and no URL history is kept. Pasted HTML is never sent anywhere. Fair-use counters use a hashed IP address, as described in our privacy policy.
Why your results might look unexpected
The six situations people run into most, and what each one means.
A ratio near zero
The page is built by JavaScript in the browser, so the HTML holds almost no text.
A very high ratio
Plain pages with little markup score high. That is fine; it is not a quality score.
Inline JavaScript dominates
Page builders, tag managers and app state such as __NEXT_DATA__ add a lot of inline code.
Large data URIs
Base64 images or fonts were written into the HTML instead of being loaded as files.
Other tools show other numbers
Tools count characters or bytes, and include or skip the head, so results differ.
403 or a challenge page
Bot protection blocked our server. Copy the source in your browser and paste it.
Questions about code to text ratio
What is a good code to text ratio?
There is no official target. SEO tools often call 10 to 25 percent normal, but the number depends on the page type: an article is text-heavy, while a shop category, a web app or a page with large menus carries more markup. Use the ratio to compare similar pages and to spot templates that are much heavier than they need to be.
Is code to text ratio a Google ranking factor?
Google has not documented it as a ranking signal. What the number points at can still matter: a lot of inline JavaScript, CSS and markup makes the HTML larger and slower to download and parse, and a page with little text in its HTML may rely on JavaScript to show its content.
How is the ratio calculated?
The visible text of the body is extracted, leaving out script, style, noscript and template elements and hidden elements, with runs of whitespace collapsed to one space. Its size in UTF-8 bytes is divided by the size of the whole HTML document in UTF-8 bytes. The breakdown splits those HTML bytes into text, markup, inline code and other parts.
Why does my React or Vue site show a ratio near zero?
Sites that render in the browser send an almost empty HTML shell and build the content with JavaScript. This tool reads the HTML as the server sends it and does not run scripts, so it sees the shell. Server-side rendering or prerendering puts the text into the HTML, which also helps crawlers that do not run JavaScript.
How can I improve a low ratio?
Look at the heaviest blocks in the report first. Move large inline scripts and styles into external files that browsers can cache, avoid repeating the same inline SVG icons, replace base64 data URIs with normal image files, remove unused wrappers and comments, and minify the HTML. Add text only where it helps readers, not to change the number.
Can I check HTML that is not published yet?
Yes. Choose Paste HTML and paste the source of any page, such as a staging page, a template or an email. Pasted HTML is analyzed in your browser and is not sent to our server.
Is the URL or the HTML stored?
No. For a URL, our server fetches the page and sends the HTML to your browser, where it is analyzed; no copy and no list of URLs is kept. Pasted HTML never leaves your browser. Fair-use counters are kept for up to a day under a hashed version of your IP address, as described in our privacy policy.