Code to text ratio is the percentage of actual text on a particular web page. Code is the HTML or Scripts parts of code embedded in the page, while text is the actual labels or written content on the page.
A higher text to HTML ratio indicates a better site quality and user experience.
Is it ranking factor?
Text to Code Ratio is not a search engine ranking factor, but it can tell you if you have bloated HTML that can slow down page speed, especially on mobile devices.
On March 27, 2018, Google’s John Mueller confirmed in a Google Webmaster Office Hours Hangout that code to text is not a ranking factor.
What is a Good Code to Text Ratio?
A good rule of thumb when it comes to code to text ratios is to aim for between 25-70% of visible text compared to non-visible elements (i.e., alt tags)