Code to Text Ratio Checker
Computes the visible text content ÷ total HTML markup ratio (as a percentage) from a live URL fetched through a CORS proxy or directly from pasted HTML. Outputs include total page size, code size, extracted text size, the percentage ratio, and a qualitative assessment. Settings toggle stripping of script tags, style tags, and HTML comments before measurement, allow a custom CORS proxy URL, and expose the extracted text for review.
This tool needs the network to work and can contact api.allorigins.win. Those services have their own privacy policies.
Documentation
The code to text ratio checker measures the proportion of visible text content against the total HTML markup of a webpage, calculated as extracted text size divided by total page size. A higher ratio means a content-rich page with leaner markup, which can support search engine rankings and faster page loads; a low ratio often points to bloated markup, heavy inline styling, or thin content buried under a lot of code.
Two input modes cover a live URL or pasted HTML. A URL is fetched through a CORS proxy, because a browser's same-origin policy blocks one site from reading another site's HTML directly; the proxy fetches the page and returns it with headers the browser is allowed to read. A proxy that fails or is rate-limited can be swapped for another, or the raw HTML can be pasted directly by copying it from a page's View Page Source view.
Results report page size (total), code size, text content size, and the code to text ratio as a percentage, followed by a qualitative assessment of that range. Settings can strip script tags, style tags, or HTML comments before measurement, which changes what counts as markup versus content, and the extracted text itself can be reviewed to confirm what the tool identified as visible content.
The code to text ratio of any webpage surfaces actionable optimization opportunities. SEO specialists, web developers, and content strategists rely on this metric when refining existing pages, comparing competitors, or shipping new ones.
- SEO Auditing: Content-thin pages surface during a technical SEO audit by comparing ratios across a site, prioritizing the ones that would benefit most from additional text or reduced markup bloat.
- Competitor Analysis: The ratio of a competitor page ranking above a given page gauges whether content density correlates with search performance.
- Web Development: Pages with excessive inline styles, redundant scripts, or bloated frameworks show up as inflated code size, a starting point for prioritizing cleanup and refactoring.
- Content Strategy: Whether a landing page, blog post, or product page contains enough visible text relative to overall page weight shows up directly in the ratio; a very low ratio can signal content buried under heavy markup.
- Performance Optimization: Pages with high code-to-text ratios often load slower because browsers parse more HTML before rendering. Reducing unnecessary code improves both perceived and actual load times.
- Quality Assurance: A pre-launch checklist can verify that new pages meet minimum content density standards before they go live.
- Email Template Testing: Email HTML evaluated the same way shows the ratio of visible text against the structural table layouts and inline styles email clients require.
Inputs, outputs, and what the Code to Text Ratio Checker computes
What the Code to Text Ratio Checker asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Enter URL / Paste HTML Code · default: Enter URL
- Page URL (URL input)
- HTML Code
- Strip script tags from text extraction · default: on
- Strip style tags from text extraction · default: on
- Strip HTML comments from code size · default: on
- CORS Proxy URL (for URL mode) (text input) · default: https://api.allorigins.win/raw?url=
Controls
Analyze · Reset