HTML validation, often called W3C validation, checks whether a page’s markup follows the rules of the HTML specification. A validator reports problems such as unclosed elements, wrongly nested tags or attributes that are not allowed.
How does validation work?
The W3C markup validator at validator.w3.org/nu is powered by the Nu Html Checker (vnu). The checker examines HTML, CSS and SVG. It runs as a web service, from the command line against files, directories or URLs, and as a Docker image, and its source code is open on GitHub.
The W3C lists reasons to validate, among them easier debugging because browsers handle errors differently, more maintainable code and markup that future platforms will handle as designed. The same page states the limits. Valid markup does not guarantee that a page looks the same everywhere, and it does not guarantee accessibility.
Does validation matter for SEO?
Google’s essential technical requirements do not list valid HTML. They ask that Googlebot is not blocked, the page returns HTTP 200 and the page has indexable content. The documentation on supported meta tags adds one point: the head section must be valid HTML so that tags such as robots or viewport are read correctly.
Example
A validator reports at least two problems in this snippet.
<head>
<title>Example</title>
<title>Duplicate</title>
</head>
<body>
<p>Text <b>bold <i>italic</b></i>
</body>
The head contains two <title> elements although only one is allowed, and the <b> and <i> tags overlap.
Common mistakes
- Working through every validator message without judging impact. Many warnings affect neither display nor processing.
- Checking only the home page. Category, product and article templates often behave differently.
- Equating valid markup with accessible markup.
FAQ
Can the validator be run locally?
Yes. The Nu Html Checker is available as vnu.jar, a Docker image and an npm package.
Which formats can be checked? HTML, CSS and SVG.
Sources
- Why validate? – W3C Markup Validation Servicevalidator.w3.org
- Nu Html Checker (vnu)validator.github.io
- Meta tags that Google understands – Google Search Centraldevelopers.google.com
- Essential technical requirements – Google Search Centraldevelopers.google.com
Last updated: