Code to text how much and why

Hire a design agency to create your website

The code to text ratio on web pages is something that we don’t talk about that much in SEO, so I feel that I should give you a quick explanation of what it is and why it matters. The code to text ratio is how much HTML markup you have on a web page compared to how much content.

So what is the perfect code to text ratio? The answer is the lower the code and the higher the text, the better.

People consider the code to text ratio important because some search engines use it as part of their algorithm. Search engines will only read and index the content of a page to calculate the relevancy of it. However, sometimes the spiders might leave the site without crawling the entire page if the site is too big. A low content ratio will probably prevent the search engine spiders from indexing the entire page and may leave some vital and relevant content behind because of too much HTML markup.

So how can we get a higher content ratio? Here are some tips below:

  • More content-as much content as possible, at a minimum 250 words
  • Use CSS for layouts and put it into external files
  • Put Javascript into external files
  • Fewer HTML comments, some search engines will count these as part of the ratio
  • Take out unnecessary tags
  • Use valid code