Text to HTML ratio is healthy

medium

content_text_html_ratio

Checks the ratio of visible text to total HTML code.

What does this rule check?

The text-to-HTML ratio measures how much of the page's code is actual content versus markup, scripts, and styles. A low ratio suggests the page is bloated with code and has little visible content. A healthy ratio is typically above 10-15%.

Why is this important?

A low text-to-HTML ratio can signal thin content or code bloat to search engines. Pages with excessive JavaScript, inline styles, or hidden elements may be penalized.

How to fix

Increase visible content, externalize CSS/JS files instead of inlining, remove unnecessary markup, and clean up unused code.

Examples

Incorrect
<!-- 50KB of HTML with only 2 paragraphs of visible text -->
Correct
<!-- Clean HTML with substantial visible content, external CSS/JS -->

Agent fix snippet

Copy this snippet and paste it into your AI coding agent to fix this issue automatically.

Improve text-to-HTML ratio:
1. Move inline styles to external CSS files
2. Move inline scripts to external JS files
3. Remove commented-out code and unnecessary markup
4. Add more meaningful content to the page