NHRepon
Home
Services
All ServicesWeb Application DevelopmentMobile Application DevelopmentDigital Marketing and SEO
ProjectsToolsProductsPostsAboutContactLogin
HomeServicesProjectsToolsProductsPostsAboutContact
  • Home
  • Projects
  • Posts
Home/Tools/SEO Tools/Code to Text Ratio Checker
All Tools

Code to Text Ratio Checker

Measure how much of a page's bytes are readable text and how much is markup, script and style — the ratio search engines have long used as a rough signal of a content page.

Text to code ratio

0.00%

Visible text

0 bytes

Markup, script and style

0 bytes

Whole document

0 bytes

Nothing to measure

Paste some HTML to see the ratio.

What the ratio does and does not tell you

The code-to-text ratio is the proportion of a document's bytes that survive when markup is stripped away. It exists because the two things scale differently: text grows with what you write, while markup grows with how the page is built. A page with a heavy framework, a long style block and a large script bundle can be mostly code even when it carries a genuine article, and a page of plain HTML with a few paragraphs can be mostly text. The figure is therefore a description of a document, not a quality score.

Historically it mattered more than it does now. It was once a crude proxy for whether a page was real content or a wall of links and keywords, and it is still a useful smell test for a template that has gone wrong — a product page where the description never made it into the HTML, or a blog post whose body is loaded by JavaScript after the initial response. Modern crawlers execute script and understand layout, so a low ratio is not the penalty it was once imagined to be, but it remains a fast way to notice that content is missing from the source.

Three cautions come with reading it. Measure the server's HTML, not the live DOM after script has run, or you will measure the rendered page rather than the one a crawler receives first. Exclude shared chrome — the header, navigation and footer common to every page — or a small page will be judged mostly on boilerplate. And remember the ratio says nothing about whether the text is any good; a page stuffed with repeated filler scores exactly as well as one with a careful article, and this tool cannot tell the difference between them.

What is the code to text ratio?

The code to text ratio is the share of a web page's bytes that remain when the markup is stripped away. Paste the source of a page and this tool removes comments, script blocks, style blocks, tags, attributes and HTML entities, measures what is left in bytes, and reports it as a percentage of the whole document. The text that was counted is shown underneath, so the figure can be checked against what it claims to measure.

The number exists because the two things grow at different rates. Text grows with what an author writes, while markup grows with how the page is built: a framework's wrappers, a long inline style block, a bundled script and a nest of containers all add bytes without adding a single word a reader can use. A page that is 4% text is therefore normal for an application shell and worrying for an article, and the same figure can mean opposite things depending on what the page is for.

Modern crawlers execute JavaScript and reason about layout, so the ratio is not the ranking factor it was once assumed to be. What it remains is a fast, honest way to notice that content is missing from the source: a product page whose description never made it into the HTML, a blog post whose body arrives only after a script runs, or a template that has quietly stopped rendering its main text. For that job it is still worth the thirty seconds.

How to check a page's code to text ratio

  1. Open the page you want to measure and view its source — the server's HTML, not the live DOM after scripts have run.
  2. Copy the source, or just the region you care about, and paste it into the box.
  3. Read the ratio, and the byte counts for visible text, code and the document as a whole.
  4. Check the extracted text underneath: if a section you expected is missing, it was inside a script or a template.
  5. Copy the figures, or clear the box and measure a second page for comparison.
  6. Where the ratio is very low, use the extracted text to decide whether content is genuinely absent rather than simply hidden.

Code to Text Ratio Checker limits and rules

Limits, caps and standards referenced by this tool
ItemLimit
InputRaw HTML source, or a fragment of it; a full document gives the more meaningful figure
Counted as textCharacters outside tags, comments, script blocks and style blocks, with entities removed
Counted as codeTags, attributes, comments, script and style blocks, and HTML entities
MeasureUTF-8 bytes, so multi-byte characters count more than one
ScriptsJavaScript is not executed, so content injected at runtime is not seen
OutputThe ratio, three byte counts, a plain-language verdict and the extracted text
Not coveredFetching a URL, rendering a page, or judging whether the text is any good

When to use it

  • Checking whether a page's main content is present in the server's HTML.
  • Comparing a template-driven page against a hand-written one.
  • Noticing that a framework has wrapped a short article in a large amount of markup.
  • Confirming that the text extracted from a page reads as expected.
  • Measuring a fragment such as an article body rather than a whole document.

Is it private?

Everything is measured in this page with a single pass over the text you paste. No URL is fetched, no page is rendered, and nothing is uploaded, stored or logged.

Frequently asked questions

There is no single good figure, which is why the verdict here is phrased rather than scored. A conventional content page commonly lands between about 25% and 70% text, an application shell or a JavaScript-rendered page is often well under 10%, and a plain article with little around it can exceed 80%. What matters is whether the figure matches the page's job — a low ratio on an article means content is missing, while a low ratio on a dashboard is entirely expected.

Most often because the text is not in the HTML you pasted. A page built with a client-side framework ships a small shell and a large bundle, and the words arrive after the script runs, so the source really does contain very little text while the rendered page contains plenty. The extracted text box makes that visible immediately: if the body is missing from it, a crawler that does not execute script sees the same empty shell. Measuring the server's response rather than the live DOM is the whole point of the check.

Not as a goal in itself. The ratio is a description, not a score, and chasing it usually means deleting things that help — a stylesheet, a script that makes the page work, a block of semantic markup. The useful version of the exercise is the reverse: if the number is unexpectedly low, find out why, because the usual causes are content missing from the source, an enormous inline style or a shared template. Fix the cause and the figure will follow. Trimming markup purely to move a percentage is working on the wrong problem.

Because a page is transferred as bytes and that is what the ratio has always described. The distinction matters as soon as text is not plain ASCII: a single character in a non-Latin script can be two or three bytes in UTF-8, so a page in Bengali or Chinese carries more bytes per visible character than a page in English. Measuring bytes keeps the comparison honest across languages and matches the transfer cost, which is the thing the figure was originally a proxy for.

It treats an entity such as & or é as code rather than text, because that is what it is in the source: characters standing in for characters. The consequence is that a page heavy in entities — one full of ampersands and accented letters written the long way — reports slightly less text than a browser would display. Stripping them entirely rather than expanding them keeps the measurement about the document as written, which is the more useful of the two readings when the question is how much markup a page carries.

Yes, and it is often the better way to use it. Pasting an article body, a product description block or a single component isolates the part you actually care about, which removes the shared header, navigation and footer that would otherwise be counted against a short page. The ratio is then a statement about that fragment rather than the whole document, which is exactly what you want when the question is whether a template is emitting its content rather than whether a site is fat.

Related tools

  • Keyword Density Checker
  • Readability Score Checker
  • SEO Audit
  • HTML Viewer
  • Character Counter

Written and maintained by Md. Nur Hossain Repon.

NHRepon


Md. Nur Hossain Repon expert in NextJS, React, React Native and Flutter. He is a full-stack web and mobile application developer with 5+ years of experience and a passion for building innovative and robust application. Also, he has a strong background in developing high-quality web and mobile applications using the latest technologies and frameworks.
Let's build something amazing together 🚀

Quick Links


  • About
  • Projects
  • Services
  • Contact
  • Posts
  • Products
  • Privacy Policy
  • Terms of Service
  • Tools
  • Smart Life Hubs

Newsletter


We respect your privacy. Unsubscribe anytime.

Connect


© 2026 NHRepon. All rights reserved.

Build v1.5.4+56.73c4a90