Code to Text Ratio Checker

Measure how much of your HTML is real readable text versus code, with a verdict on thin-content risk.

Measure code-to-text ratio of any HTML instantly. Free ratio checker with visible-text extraction, verdict and bloat diagnosis.

Calculator Inputs

About Code/Text Ratio

Measure how much of your HTML is real readable text versus code, with a verdict on thin-content risk.

Paste full page source. Scripts, styles, and comments are stripped first (they inflate code without helping readers), then visible characters are weighed against the total. The verdict bands reflect practitioner norms: under ~10% usually means thin or bloated, 15–30% is typical, higher suits long-form content.

Ratio is a diagnostic, not a ranking factor — Google has never confirmed it as one. Pair it with word counts and coverage checks. Everything runs in your browser.

Where it is used

Diagnosing thin pages, auditing template bloat from builders and tag managers, and benchmarking before rewrites.

How to use the Code/Text Ratio

  1. HTML Source — enter the value (e.g. <html><body><p>Hello world</p></body></html>).
  2. Calculate — press the Calculate button to see the result instantly above.

Formula

Ratio = visible text chars (scripts/styles/comments stripped) / total HTML chars × 100.

Examples

Example

htmlInput:<html><body><p>Hello world, this is a test of the ratio checker.</p></body></html>
Result: Ratio ≈ 60%+ (short markup, real sentence)

Frequently Asked Questions

Is code-to-text ratio a Google ranking factor?
No — Google has never confirmed it. It is a useful proxy: very low ratios often correlate with thin content or heavy templates, which do matter.
Why strip scripts and styles first?
Because they are code by definition. Counting them would punish every JavaScript-heavy page, including fast, content-rich ones.
What ratio should I target?
There is no magic number, but 15–30% covers most healthy pages. Below 10% with under ~300 words of copy deserves attention.