Share this post:

Share on facebook
Share on twitter
Share on linkedin

Is ‘Code to Text Ratio’ a Google Ranking Factor?

  • What is HTML to text ratio?
  • What is the optimal code to text ratio for web pages?
  • Does the text to code ratio of a web page impact ranking signals?
  • How to improve your text to HTML ratio


Most web pages are written in HTML (hypertext markup language) code and translated by your web browser into display content.

No doubt you’ve heard rumours circulating the Internet about the importance of having a healthy code to text ratio. But do search engines such as Google, really take the HTML to text ratio into account? Is it a ranking signal in search algorithms?

We’ve outlined below whether the HTML to text ratio is an important ranking signal.

HTML Code on a laptop

What is a Code to Text Ratio?

The code to text ratio refers to the percentage of text on a specific webpage in relation to the amount of HTML code required embedded.

Essentially, it’s a ratio that informs search engines of the amount of text your webpage should contain, but those of our readers that are part of a marketing team or own an eCommerce business should not be phased.

While a higher text to HTML ratio is indicative of a better user experience (UX), the ideal HTML to text ratio is not as big as you think.

What is the Ideal Code to Text Ratio?

When it comes to displaying content on a webpage, the ideal HTML to text ratio is anywhere between 25-70%. The percentage refers to the amount of visible text on the page as opposed to other non-visible elements, including:

  • ALT tags
  • Captcha
  • Charts
  • Graphs
  • Downloadable files such as PDFs

If you conduct a website comparison, you might notice that high-ranking websites have significant amounts of visible text, especially in Google search results. 


The Panda algorithm update continues to reward content-driven sites and diminish the presence of websites with thin or poor content in search engine result pages (SERPs). Many SEO professionals will know that Google considers content to be one of the most important ranking factors.

Anyone who has built a website will also know the challenges of constructing pages with significant amounts of content. Likewise, the pain points that HTML to text ratio can have on UX and page speed are factors most digital marketers have confronted.

But is the code to text ratio even a ranking factor for search engines?

Do Search Engines Consider HTML to Text a Ranking Factor?

According to Webmaster Trend Analyst John Mueller, Google does not have a text to code ranking algorithm. However, he noted that search engines use it to determine whether web pages have “bloated” HTML, especially if the page loading speed is slow, as this will negatively impact UX.

So, while the code to text ratio does not directly impact rankings for search engines, there are many factors related to the ratio that suggests it could indirectly affect ranking signals.

Many SEO professionals have stressed the importance of having a good HTML to text ratio, arguing that it helps search engine crawl bots determine the relevancy of webpages. Besides loading issues caused by bloated HTML, search engines could struggle to understand what your webpage is about if it lacks visible text.

If search engines crawl your web page but struggle to determine the context of that page, chances are competitors who have a higher code to text ratio will appear higher in SERPs.

HTML impact on SEO

Is HTML to Text Ratio Important For SEO?

Now you know that search engines don’t use the code to text ratio as a ranking factor, is it still relevant for SEO?


Using tools such as Google Search Console (GSC), you can identify whether your web page’s code to text ratio impacts UX, especially on mobile. How?

The Core Web Vitals report in GSC can tell you whether you have a bloated “HTML” through three primary factors:

  • Page loading speed
  • How your page loads
  • Layout shifts

Identifying weak areas in your site can help you improve SEO and boost user experience. Remember, usability is related to customer satisfaction – a good user experience goes hand in hand with profit.

When structuring and populating your web pages with content, aim for an HTML to text ratio of 25-70% to avoid creating a poor UX.

How to Improve Your Text to HTML Ratio

Like SEO, the key to optimising your HTML to text ratio is to improve the user experience. Building your web pages with the user in mind will encourage people who land on your site to stay, which will help your performance in SERPs.

We advise starting with making sure your HTML code is valid, which you can check with tools such as W3C’s Markup Validation Service. 

Once you’ve determined that your HTML is valid, evaluate your page speed. Again, less code will indicate that you don’t have unnecessary HTML elements embedded on your web page, increasing loading speed and improving UX – a direct ranking factor.

If you have a lot of HTML code, remove the unnecessary elements, such as:

  • White spaces
  • Tabs
  • Comments
  • Inline styling

If possible, avoid using tables as they produce a lot of HTML code.

Finally, eradicate any hidden text, compress and optimise your images and try to keep the size of your pages under 300kb. Following these steps will improve your HTML to text ratio and page loading speed, making it easier for search engines to crawl and index your site. You can use Siteliner to quickly check your website’s average ratio as a very handy tool when looking to minimise your HTML to correct speed issues on your site.

While the HTML to text ratio does not directly impact ranking signals, the evidence outlined above shows that optimising your HTML code could improve your page loading speed and boost UX, which is a significant search engine ranking factor.

You may also be interested in...

Semantic SEO and different spoken terms

How to Use Semantic SEO to Boost Traffic & Search Rankings

Over the years, search engines have become more intelligent and adopted processes such as semantic analysis to understand human language better and deliver more relevant search results to users. To keep up with the times, marketers need to change their approach to keyword research and utilise semantic SEO to build topical authority.

Read More »
Content Marketing in 2022

The Anatomy of Top-Performing Organic Content in 2022

Engaging content needs to be original, relevant and offer value to the user via an extensive criterion that ranges article length to visual elements and content quality. Technical factors such as article structure, internal links, and image ALT tags also play an essential role in a winning content formula.

Read More »

Web Traffic Results, Trends & Benchmarks For 2022

Over the last few years, we’ve witnessed a phenomenal increase in website traffic, especially mobile traffic, accounting for approximately 55% of total web traffic in 2022.
More and more consumers use their smartphones to discover new brands, shop online and research products or services.

Read More »
Spelling & Grammar Impacting SEO Strategy

Spelling & Grammar: Is It A Google Ranking Factor?

The introduction of artificial intelligence (AI) and machine learning to support algorithmic processes such as RankBrain is steadily gaining weight among the top ranking signals, meaning marketers should seek to practice good spelling, grammar and punctuation.

Read More »
Instagram marketing tips

Instagram Marketing Tips for 2022

According to the latest statistics, Instagram has 1 billion monthly active users and 500 million daily active users, making it one of the most popular social media networks globally.

Read More »
MarTech Awards Logo

Soar Online
Best Boutique SEO Agency UK

Excellence Award for Digital Recovery Services 2022

Track the keywords & phrases your clients would use to search for your business

Use our handy tool to receive keyword ranking reports on a weekly basis – it’s fast and free.

500 Club

5 Fantastic Benefits
only £500 per month

The Digital Revolution is happening right now

Give your online business some altitude.

Contact Us

This field is for validation purposes and should be left unchanged.