Before I begin to list the reasons why you should validate your websites, lets take a step back and look at what validation actually is.
What is W3C Validation?
Validating your webpages means updating your code (ie. HTML and CSS) to meet the technical specifications and guidelines outlined by the W3C (World Wide Web Consortium). Their primary goal is to ensure that the World Wide Web and all websites work as well as they possibly can and are accessible by all who use the web.
Validation can be done for free by visiting the online W3C validation tool at http://validator.w3.org.
Reasons to Validate
1) It shows up errors in your code
By running your code through the W3C validator you will be alerted to any errors in your markup such as missing or invalid tags. If you do encounter any of these errors yet your site still looks ok in your browser, bear in mind that it looks ok because your browser is catering for this error and is displaying what it believes should be displayed. Note that this may not be the case in all browsers.
2) Future-proof your site
How long is the average site around for? 1 year? 3 years? 10 years? By validating your site today you are saving yourself time in the upcoming years when new browsers are released and your code, including any hacks, go out of date.
3) Look professional
It might be just me but quite often I’ll run a website through a validator when studying it for the first time, especially if it is a site I am going to be working on. At a quick glance I can then see how well the site is constructed based on the number and the type of errors. I know you shouldn’t judge previous developer’s skills based on whether their code validates but if someone is still using <font> tags in the (X)HTML, for example, it tells me that maybe their coding is a bit rusty.
I also think it’s important for web developers to validate their code if the site they’re building is going into a portfolio. It can take a couple of minutes to validate a site and if it means the difference between getting a new job or not I would say it’s definitely worth it
Other Things to Note
Remember that a valid website will not necessarily automatically appear and function the same across all browsers and devices. It is important that you still test your site across as many browsers as possible to ensure the best experience for all visitors.
Do not fret also if your site doesn’t validate. It is not the end of the world and if you have an existing site that has thousands of pages, don’t worry too much about spending every minute of the day validating every page. I generally tend to look at validating my sites when first building them or, if the site already exists, when I have some spare time to revisit the code.