Is an HTML code validated by W3C useful for ranking?
Do the pages of your website pass the W3C Markup Validation Service? Congratulations. Unfortunately for you, there is no bonus or premium following this validation.
Why would the content of a page be less relevant if, for example, there is only one unclosed tag?
However, we have to admit that many of the recommendations made by the W3C are exactly in accordance with the expectations and criteria adopted by search engines.
For example, the content of the alt attribute of an image must be specified so that the users who can't visualize it can still get a relevant description of the image.
A search engine that is, not yet, able to visualize correctly and at lower costs the images will use the content of this attribute to get to analyse better your page.
We could draw the same kind of analogy on dozens of criteria.
But above all, you must create websites that comply with standards by following a logic of quality of excellence and accessibility. That is far beyond the issues raised by SEO and also make your website more qualitative regarding conversions.
It is also worth pointing out that from the point of view of accessibility, it's very possible to create a valid code and finally obtaining a website suffering from major accessibility issues. The opposite is also completely true(not to mention the loading speed).