HTML Validator
Validates HTML documents for well-formedness and best practices: finds missing or unbalanced tags, unknown elements, duplicate IDs and more.
Loading tool...
What the HTML validator checks
The validator tokenizes your document exactly like a browser does and then rebuilds the element tree, applying the HTML5 rules for void elements and optional end tags. Everything runs in your browser; nothing is uploaded. Issues are reported with their line and column and grouped in three levels:
| Level | What it means |
|---|---|
| error | The markup is invalid HTML5: browsers will recover, but usually not the way you intended. |
| warning | Valid but discouraged: obsolete elements and attributes, missing metadata, accessibility problems. |
| info | Style and best-practice hints: inline styles and handlers, upper-case tags, heading structure. |
Structural errors
- Unknown elements — every HTML5 element is accepted, including
main,section,article,details,dialog,template,slot,picture,video,canvas,svgandmath. Custom elements are accepted when their name contains a hyphen. - Unclosed and mismatched tags — each end tag must match the innermost open element, taking into account void elements and optional end tags.
- Content model —
<p>may only contain phrasing content;<li>must be a child oful/ol/menu; links cannot be nested in links. - Attributes — duplicate attributes, duplicate
idvalues, unterminated quotes, missing whitespace between attributes. - Doctype and syntax — missing doctype, obsolete doctype, unescaped
<in text, unterminated comments.
Best-practice warnings
- Missing
<title>, missing<meta charset="utf-8">, missinglangattribute on<html>. - Obsolete elements:
font,center,marquee,blink,applet,frame,frameset— with the modern replacement. - Obsolete presentational attributes:
bgcolor,align,valign,border,cellpadding,cellspacing. - Accessibility hints:
<img>withoutalt, form controls without<label>, links with no accessible name.