HTML Tag Validator
Validate that an HTML document is well-formed: every opening tag has a matching close, in the right order. Reports unclosed, stray, unexpectedly-closed and mismatched tags with the line where each problem is, and understands void elements (<img>, <br>…), self-closing syntax, comments, doctypes and raw text like <script> and <style>. On your device, with no network.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What it validates
The tool walks the markup with a tag stack and reports, with a line number, every unclosed tag, every close with no matching open, an unexpected close that ends the wrong element, and a stray "<" that starts something unparseable. The result is a two-column table of line and issue, plus counts of tags and problems.
Why tag balance is the check worth having
A single unclosed div is the classic reason a whole page suddenly lays out wrong, and it is easy to introduce and hard to spot in a long template. This validator pinpoints the line in seconds and avoids attribute-level nitpicking, so the one error that breaks rendering stands out.
The rules it knows
The HTML void elements — area, br, col, embed, hr, img, input, link, meta, param, source, track, wbr — need no separate close tag. Script, style, textarea and title contents are treated as raw text, so a "<" inside a script string is not mistaken for a tag. Comments and doctypes are recognised.
What a passing result does not promise
This is structural well-formedness only. Attributes, ARIA rules, spec-mandated nesting and link validity are outside its scope, and a tidy document that parses can still be semantically invalid. It is the fast first check that catches the failure mode which breaks an entire page.
Checked in the tab
The markup is scanned by a small local parser with no network access, so a draft page or a fragment under NDA can be pasted in safely. There is no upload and the tool works offline.
Questions
What does it actually check?
Tag balance: every opening tag is matched by a close of the same name in the right order, comments and doctypes are well-formed, and stray "<" or unknown constructs are caught. It does not check attributes, nesting rules of the spec, or link validity.
Which tags are “void”?
The HTML void elements (area, br, col, embed, hr, img, input, link, meta, param, source, track, wbr) are treated as self-closing by spec — they do not need, and must not have, a separate closing tag. Script, style, textarea and title contents are treated as raw text.
Is a passing result proof the page renders?
No — this is structural well-formedness only. A tidy parser-parseable document can still have broken attributes or invalid nesting; those need further tools. This catches the common “unclosed tag breaks the whole page” failure fast.
Related tools
See categoryHTML Prettifier
Beautify HTML output — indented tags, one attribute per line for long tags, preserved text.
HTML to Plain Text
Strip HTML tags to clean, readable plain text — entities decoded, block layout preserved.
HTML to Markdown
Convert an HTML snippet or page into clean Markdown, on device, no server.
Markdown to HTML
Convert Markdown to HTML source code — see the generated markup, not a preview.