A recent tweet from Google's Garry Illyes called attention to the problem of invalid HTML. It is less known that although, Google is fine with an invalid HTML there are negative outcomes associated with it. That's why Google support pages encourage publishes to code valid HTML only.
Here are 6 main reasons that advise why to use valid HTML always.
1) Could affect the crawl rate: In a Google search console page, Google advises that invalid HTML could affect the crawl and indexing of a web page. If a GoogleBot cannot analyze the content (broken HTML or unsupported content) of the web page, it won't be able to crawl them.
2) Browser compatibility: A valid HTML code will help assure that your site renders well across all the browsers. For example, CSS custom properties are not supported by the version of Chrome used by GoogleBot for page rendering.
3) Positive user experience: It's clear that Google uses the user experience as a sign in the ranking process. A valid HTML can help a web page functions flawlessly across all devices, browsers and operating systems, making it a positive user experience as the page renders quickly and perfectly.
4) Ensuring page functions everywhere: A poorly coded HTML makes the browser to go into quirks mode. Quirk modes mean the browser makes changes to how the page is rendered. Usually,m it renders fine, but sometimes invalid HTML makes pages do not function properly.
5) Google Merchant Center: it is a tool for creating shop ads and they also suggest using valid HTML code. They said,”We also detect the price that you're displaying on your landing page and a valid HTML can help to ensure the correct price.”
6) Invalid HTML in Head Section Breaks hreflang: An invalid code in the head section can break Google’s crawl and cause it to not index the hreflang tags.
With all Google support pages, it's assured that how much a valid HTML matters for your web pages. Validating your web pages not only help you to rank higher on Google but also protect them from unforeseen errors.