Skip to content
search-engine-optimizedby Netsolution
  1. Home
  2. Page analysis
  3. Code to Text Ratio

Code to Text Ratio

Measure the share of your page that actually serves a purpose.

A comparison between the weight of the raw source code and that of the readable text once tags, styles and scripts are removed. No usage limit.

What this tool is for

This ratio compares two things: the weight of the code sent to the browser, and the weight of the text a visitor can actually read. A 400 KB page with 12 KB of text says it at a glance: most of what was transferred is not what gets read.

Let us say it up front: it is not a ranking factor. Google does not consult this value. The 15 or 25 % thresholds found more or less everywhere come from no official source.

What the measurement does reveal is concrete. A very low ratio means your visitors download a substantial volume of code to reach little content. On mobile, over an average connection, that translates into seconds of waiting — and seconds do count for rankings.

The right way to use it: as a thermometer. It is not something to treat, it tells you to look elsewhere — at the inline styles, the scripts and the dead code.

How to read the results

This page shows no grid of thresholds, and that is consistent with what is written above: no boundary carries authority, and publishing one more would be manufacturing the reference we have just said does not exist. What follows describes situations, not grades.

The code mostly serves to structure the text. The transfer is dominated by what gets read. Nothing to do.

The code weighs several times the text. That is the ordinary state of a site built with a current development framework, which naturally produces a lot of tags. No cause for concern in itself.

The text becomes marginal in the transfer. There is something to look at. Start with the styles and scripts included directly in the page: that is nearly always the first item.

The text disappears behind the code. Something significant is weighing the page down: a visual builder producing dozens of nested levels, a bulky tracking module, or code left by an abandoned feature.

The most useful reading is comparative anyway, and it needs no thresholds: measure several pages of your site. A page well below the others has a problem of its own, and it is generally easy to identify.

Common mistakes

Taking the ratio for an objective. Adding text solely to raise the percentage produces padding, which degrades the page instead of improving it.

Deleting useful HTML. Removing semantic tags or structured data raises the ratio and loses information valuable to engines. The number improves, the page degrades.

Believing Google scores it. No Google documentation mentions this measurement anywhere. Spending time optimising it for its own sake diverts time from what counts: content and speed.

Ignoring what it reveals. The opposite excess: an extremely low ratio signals a real weight problem, even if nothing in the documentation makes it a factor. The speed test will confirm the impact on the experience.

Comparing pages of different natures. A blog article and a home page do not have the same purpose. Compare like with like, between pages of the same type.

Going further

Frequently asked questions

What ratio should I reach?

No threshold carries authority, and Google does not use this measurement as a factor. The 15 or 25 % values in circulation come from commercial tools, not from Google’s documentation. A low ratio is not a fault in itself: it is a symptom inviting you to look at why the code is so heavy.

Why is my ratio very low although my page is rich?

Almost always because of CSS and JavaScript included directly in the page rather than in separate files. A site built with a visual editor commonly produces hundreds of style lines per block. The page stays correct, but it carries a considerable weight on every visit.

Does improving this ratio improve ranking?

Not directly. What raises it, though — moving styles out, slimming scripts, removing dead code — improves load time, and that genuinely counts. So you are not working for the ratio, but for what it reveals.

Does the ratio count invisible code?

Yes, and that is the whole point. A hidden dropdown menu, a collapsed footer, a modal never opened: all of it is downloaded on every visit even if nobody sees it. That invisible code weighs as much as the rest on load time.

Is a high ratio necessarily good?

No. A very bare page can show an excellent ratio and lack structure: no heading hierarchy, no structured data, no semantic tags. A high ratio obtained by deleting useful HTML is a poor trade.

How do I concretely improve this ratio?

In this order of return: move styles and scripts into cached external files, remove dead code left by old features, simplify pointless stacks of divs, and strip comments in production. Those moves reduce the weight transferred, which is the real objective.