Free HTML5 Validator
Check your HTML5 code against the latest web standards. Catch deprecated elements, missing attributes, and specification violations instantly.
What Does an HTML5 Validator Check?
HTML5 introduced significant changes to the web standard, including new semantic elements like <article>, <section>, <nav>, and <header>. At the same time, many older elements were deprecated.
Our HTML5 validator checks for deprecated elements like <center>, <font>, <marquee>, and <blink>. It also verifies that required attributes are present, like alt on images and proper DOCTYPE declarations.
Common HTML5 Issues
Missing DOCTYPE
HTML5 requires <!DOCTYPE html> at the top of every document.
Deprecated Elements
Tags like <center>, <font>, and <big> are no longer valid in HTML5.
Missing Alt Attributes
Images must have alt text for accessibility and HTML5 compliance.
Incorrect Nesting
Block elements inside inline elements violate HTML5 content models.
Missing Lang Attribute
The <html> element should have a lang attribute for accessibility.
Unclosed Tags
While HTML5 is more lenient, unclosed tags can cause unpredictable rendering.
Valid HTML5 That Looks Wrong
HTML5 is more permissive than its reputation. Each of these returns zero errors, because the specification allows it, and a validator that flagged them would be teaching you rules that do not exist:
- Unquoted attribute values
<p class=intro> - Omitted end tags
<p>One<p>Two - Custom elements
<my-widget>...</my-widget> - Popover and dialog
<div popover id=menu>
Errors and Warnings Are Not the Same
An error here means the HTML breaks the WHATWG specification: <center> (removed from HTML), an <img> without alt, a <div> directly inside a <ul>, two elements sharing an id, a <div> inside a <p>. A warning means the HTML is valid but falls short of a best practice, such as an <iframe> with no accessible name.
The difference matters because most of the web fails the first bar. In our crawl of the Tranco top 5,000, 87.2% of the 2,656 sites we could read break the HTML specification on their home page. The full study lists the most common errors, and each one links to a guide to fixing it.