The question of whether or not Google will penalize a site for not using absolutely clean, valid HTML coding comes up a lot. For many years most SEO companies believed that this did have a significant impact on search engine rankings. However, Google clarified that issue several years ago. Matt Cutts recently re-iterated that Google does not penalize sites for coding errors in the following video.
There are good reasons for making sure that code is cleanly written, but you do not have to take this to extremes. Modern browsers can correct most code that is poorly written, but valid code renders faster in browsers. If performance is one of your concerns, then you should be validating the pages and correcting any errors identified by the W3C Validator. The W3C (Words Wide Web Consortium) is the organization that sets the standards for web page coding. Browsers work most efficiently when they do not have to take the time to correct coding issues.
The person that raised the question in the Matt Cutts video notes that Google own very simple home page exhibits 23 code compliance errors when run through the W3C Validator. I have sometimes seen as many as 30 errors on Google’s home page at times.
The real issue is not simple code compliance issues, which means code that does not meet the coding standard designated in a web page’s Doctype declaration. The coding issues that can cause problems involve egregious errors that prevent browsers from rendering the page properly or those that hinder a spider’s ability to parse the code and pull out the content. Even valid code using poor coding practices can hinder a spider’s ability to parse a page, such as issues with excessive table nesting or overly complex code. While these types of problems are rare, they do sometimes occur.
Today the easiest way to assure that code is simple, fast to render, and easy to parse is to use the HTML 5 coding standard and adhere to the stricter standards for that version of HTML. Proper coding with HTML 5 sometimes has a noticeable positive effect on performance. Current versions of WordPress and many popular web development platforms do use HTML 5 as their coding standard.