Skip to main content

Code to Text Ratio Checkerv1.0.0

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.

Development
Performance
Reference

Documentation

Analyze the code to text ratio of any webpage, the proportion of visible text content relative to the total HTML markup. Higher ratios indicate content-rich pages with leaner markup, which can support search engine rankings and faster page loads. Two input modes are supported: a live URL or pasted HTML.

  • Select an Analysis Mode: Enter URL or Paste HTML Code.
  • For URL mode, enter the full address (including https://) in the Page URL field. The page is fetched through a CORS proxy to retrieve its HTML source.
    Explanation: Browsers block direct access to HTML from other domains. This same-origin policy prevents one site from reading another without permission. A CORS proxy steps in as a middle layer. It fetches the page and returns the HTML with safe headers so your browser can read it. If the proxy fails or is rate-limited, paste the raw HTML or switch to another proxy.
  • For HTML mode, paste the complete HTML source code into the HTML Code textarea. Right-click any page and choose "View Page Source" to obtain it.
  • Click Analyze or wait for automatic analysis to trigger after 500 milliseconds of typing inactivity.
  • Review the results: Page Size (Total), Code Size, Text Content Size, and Code to Text Ratio as a percentage.
  • Read the assessment below the results for a quick interpretation of the ratio range.
  • Expand View Extracted Text to inspect which text was identified as visible content.
  • Open Settings to strip script tags, style tags, or HTML comments, or to change the CORS proxy URL.
  • Click Reset to clear all inputs, results, and saved settings.

Audit the code to text ratio of any webpage to surface 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: Identify content-thin pages during a technical SEO audit and prioritize those that benefit from additional text or reduced markup bloat. Compare ratios across the site to find underperformers.
  • Competitor Analysis: Check the ratio of competitor pages ranking above yours to gauge whether content density correlates with search performance.
  • Web Development: Spot pages with excessive inline styles, redundant scripts, or bloated frameworks that inflate code size. Prioritize cleanup and refactoring based on the results.
  • Content Strategy: Determine whether landing pages, blog posts, or product pages contain enough visible text relative to overall page weight. Very low ratios may 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: Run the checker as part of a pre-launch checklist to verify that new pages meet minimum content density standards before they go live.
  • Email Template Testing: Paste email HTML to evaluate 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

The form above accepts the following inputs and produces the outputs listed below. This summary is rendered in the page so the parameters are visible to crawlers, assistive tech, and indexing agents that don't fetch the embedded tool frame.

Inputs

  • Enter URL · default: url
  • Paste HTML Code · default: html
  • Page URL (URL input)
  • HTML Code
  • Strip script tags from text extraction
  • Strip style tags from text extraction
  • Strip HTML comments from code size
  • CORS Proxy URL (for URL mode) (text input) · default: https://api.allorigins.win/raw?url=

Controls

Analyze · Reset

Worked example

Read the assessment below the results for a quick interpretation of the ratio range .