HTML Validator
Check HTML for unclosed tags, mismatched nesting and duplicate IDs.
This tool runs entirely in your browser. Your files are never uploaded to a server.
Valid: No structural HTML errors found.
- Elements checked: 4
- No id attributes found.
Clear the entered value before starting another check. Validation runs locally and does not check against any external registry, server, or account.
What this tool does
Checks an HTML snippet for structural problems: genuinely unclosed or mismatched tags, a void element with a closing tag, and duplicate id attribute values.
How to use it
Paste an HTML fragment or full document. The checker walks each tag while correctly applying HTML5's optional-closing-tag rules — for example, a new <li> or </ul> is allowed to implicitly close a previous <li> — so it does not flag normal, spec-valid HTML as broken.
Example
Entering <ul><li>First item<li>Second item</ul> returns valid, since <li> has an optional end tag under the HTML5 spec; entering <div><span></div> returns invalid, since </div> closes while <span> — which always needs an explicit end tag — is still open.
Validation
Tags must close in the correct order, accounting for the standard set of elements with optional end tags (li, p, dt, dd, tr, td, th, thead, tbody, tfoot, option, optgroup); void elements (br, img, input, hr and others) must never carry a closing tag; every id attribute in the document must be unique; and content inside <script> or <style> is treated as raw text, not parsed for tags.
How to interpret the result
A valid result means the markup is structurally sound by these rules — it is not a full W3C Nu Html Checker replacement and does not check content-model nesting (such as block elements inside inline elements), accessibility, or attribute-value correctness beyond duplicate IDs.
Limitations
A trailing slash (like <div />) is treated as self-closing for every element to match common hand-written markup, even though real browsers only self-close true void elements this way and otherwise ignore the slash — don't rely on it to close a non-void element in production HTML. Deeply nested or malformed script/style content, and full document structure (doctype, head, body), are outside this checker's scope.
Privacy
All processing uses local browser APIs and this tool does not upload the values you enter.
Frequently Asked Questions
- What does HTML Validator do?
- Checks an HTML snippet for structural problems: genuinely unclosed or mismatched tags, a void element with a closing tag, and duplicate id attribute values.
- How does it handle invalid input?
- Tags must close in the correct order, accounting for the standard set of elements with optional end tags (li, p, dt, dd, tr, td, th, thead, tbody, tfoot, option, optgroup); void elements (br, img, input, hr and others) must never carry a closing tag; every id attribute in the document must be unique; and content inside <script> or <style> is treated as raw text, not parsed for tags.
- Is entered data uploaded?
- All processing uses local browser APIs and this tool does not upload the values you enter.
Related Tools
HTML Formatter
Format and indent HTML code into a clean, readable structure directly in your browser.
HTML to Markdown Converter
Convert common HTML markup into clean Markdown directly in your browser.
XML Validator
Check whether XML is well-formed using the same parser as the XML converters.
CSS Validator
Check CSS for unclosed braces, brackets, strings and comments.