The code to text ratio of a page is used by search engines and spiders to calculate the relevancy of a webpage. Not all search engines are using the code to text ratio in their index algorithm, but most of them do. Therefore, having a higher code to text ratio than your competitors gives you a good start for on-site optimization.
Use this tool calculate Text to Code Ratio of web page. 15% or higher Text to Code Ratios are considered good.