HTML Structure Validator
Check HTML structure: unclosed, mismatched or stray tags, duplicate ids and attributes, images without alt and missing doctype, title or lang. In-browser.
Checks structure only: unclosed, mismatched or stray tags, duplicate ids and attributes, missing alt text, doctype/title/lang. It is not the W3C validator.
Runs entirely in your browser. Your data is never uploaded.
Related Tools
View AllWhat is HTML Validator?
This HTML checker finds the structural mistakes that most often break layouts: elements that are never closed, closing tags in the wrong order, end tags without a start tag, duplicate ids and attributes, <img> without alt, and missing doctype, <title> or lang on full documents. It is a fast local check, not the official W3C (Nu) validator, and does not check which elements are allowed where.
How to use HTML Validator
- Paste an HTML document or fragment.
- Click Validate (results update as you type).
- Read the summary of errors and warnings.
- Use the line and column of each item to fix your markup.
Example
<div id="a"> <span>text</div> <p id="a">x <img src="a.png"> </br>
Errors: 3 · Warnings: 1 Line 2, column 1 <span> is not closed before </div> Line 3, column 4 Duplicate id "a" (first used on line 1) Line 4, column 1 <img> has no alt attribute Line 5, column 1 <br> is a void element and must not have a closing tag
When to use HTML Validator
Use it to quickly locate the tag that breaks a layout, check templates and email HTML, or catch duplicate ids before they break JavaScript or labels. For full conformance checking (content models, ARIA, attribute values) use the W3C validator.
How HTML Validator works
A tokenizer reads tags, attributes, comments and raw-text elements (script, style, textarea, title) while tracking positions. A stack of open elements follows HTML rules for void elements (br, img, input…) and optional end tags: </p>, </li>, </td> and similar may be omitted, and a new <li> or block element implicitly closes the previous one, so valid HTML5 shortcuts are not reported. SVG and MathML content allows self-closing tags. Any other element still open when its parent closes, or at the end of the input, is an error.
Common Use Cases
- Finding an unclosed div that breaks a page layout
- Checking CMS or email template output
- Catching duplicate ids that break label/aria references
- Basic accessibility check for images without alt text
Security Note
Everything runs locally in your browser; the code you paste is not uploaded.
FAQs
Is this the W3C validator?
No. It checks well-formedness and a few common problems locally. It does not check which elements are allowed inside others or attribute values.
Why is a missing </p> or </li> not reported?
HTML allows omitting those end tags; browsers close them automatically.
Does it handle SVG?
Yes, inside <svg> and <math> self-closing tags like <path/> are accepted.
Is my HTML sent anywhere?
No, the check runs entirely in your browser.