- What is text to HTML ratio?
- What is the right text to HTML ratio?
- How is this ratio calculated?
- How does Google use this metric?
- How to improve code to text ratio
- How to fix low HTML to text ratio
When optimizing your website, you may have been told to consider its text to HTML ratio. So, what does this ratio mean, and why does it matter? Keep reading to learn more!
Your web page is normally written in HTML, and the content displayed is normally in text. The text to HTML ratio also commonly referred to as text to code or code to text is the amount of text on that page compared to the amount of HTML code needed to display it.
The ideal text to HTML ratio is somewhere from 25-70%. This ratio refers to the visible text as opposed to HTML elements, non-visible information, and images tags. This explains why you see sites with more visible text ranking higher on search results.
While the HTML to text ratio is not a ranking signal, there are many factors related to the ratio that show best SEO practices. That means this ratio may indirectly hurt your ranking. But this does not mean you overlook it. Below are some reasons why it a good idea to improve it:
- Google uses it to view the actual relevancy of a page. So, the higher the ratio, the better.
- The ratio can also help improve HTML heavy pages. For example, by helping remove unnecessary images tags. HTML heavy pages have the potential to hurt loading speed and user experience.
Web pages with a higher text to HTML tend to be more user-friendly. They are readable and appealing to the target audience rather than search engines.
The lesser the code the better when it comes to page load speed. Websites with lesser code loads fasters and that contributes to better user experience. Don’t forget, page load speed is also a ranking factor.
Better user experience is a prime ranking factor today according to search engines like Google. Now considering higher text to code ratio indicates better UX, it makes sense to improve this ratio.
A cleaner, compact code and higher ratio of plain content make it easier for search engines to crawl and index a website.
- Validate your HTML code. You can use online tools to do this- it will take about one minute of your time.
- Check your website load speed. If your site is loading too slowly, that is a sign you need to review your code and remove unnecessary elements.
- Include a lot of simple text on a page and remove any hidden text that is not visible to people.
- Reduce the size of your page. It is best to keep it under 300kb. If bigger, try reducing it.
- Consider exporting CSS to an external file and using it only for styling and formatting
- Remove any unnecessary images
- Resize your images
- Avoid tables. Use tables in your layout only if necessary
- Use internal linking to help users navigate your website and make sure your links pass link juice