Use valid HTML

> valid HTML

Updated: April 3rd 2016

"Use valid HTML."

- from the Google webmaster guidelines 1

What is valid HTML?

  • Valid HTML follows the grammar, vocabulary and syntax of the HTML language.
  • The process of checking a web document for HTML errors is known as "HTML validation".
html and a check mark

What are the benefits of valid HTML?

Following the grammar, vocabulary and syntax of any language results in better communication and less chance of misinterpretation.

The manner in which HTML is written dictates what our users see and how search engines interpret our pages.

Valid HTML...

  • Is more likely to display correctly and predictably regardless of browser or device type.
  • Is more likely to be functional for users with accessibility issues.
  • Reduces possible misinterpretation by search engines (of structured data, meta data, language, encoding, etc.)
  • Is more likely to render faster in some scenarios (user may see page quicker).

Does valid HTML matter?

Different people in different roles often have different opinions on if valid HTML matters.

different roles have different opinions

In the end however, the person responsible for the profit and stability of the company should make the final decision.

Profitable CEOs try to eliminate any risks or variables that stand between them and profit.

Using valid HTML reduces several such risks and variables.

Risks of using HTML that is not valid

Risk of not displaying correctly on certain browsers or devices:

  • User can't buy things
  • Poor representation of company

Risk of search engine misinterpretation:

  • Ranking loss
  • Missed opportunity for ranking better

Risk of web site not being accessible to users with disabilities:

  • User can't buy things
  • Bad PR
  • Lawsuits

Validating HTML

The process of validating HTML often uncovers many hidden issues.

For me personally, this is why I validate all of my pages. I often find issues that would have otherwise been left undiscovered.

Valid HTML and the Google guidelines

The Google guidelines are suggested practices that help Google find, index, and rank your site.

The Google guidelines state "Use valid HTML."

That is pretty clear.

Tip: Use the Google guideline tool to see if your web pages follow the Google webmaster guidelines (including valid HTML).

How to validate your HTML

The W3C Validation tool is the authoritative tool to validate HTML.

The tool is very useful and I have been using it for over ten years.

Patrick Sexton by