HTML Validator
Check that HTML tags are properly opened and closed, live as you type.
Every tag is properly opened and closed.
Checks that tags are balanced, live as you type. This is a structural check, not a full HTML5 spec validator (it won't catch every possible validity issue W3C's validator would). Runs entirely in your browser; nothing you type is sent anywhere.
Need the opposite? HTML Tester
What is HTML Validator?
Paste HTML and this tool checks that every tag is properly opened and closed, flagging any mismatch immediately, a quick way to catch a stray unclosed tag before it breaks a page's layout. An unclosed `<div>` or mismatched tag is a common source of layout bugs that don't throw a visible error; the page just quietly renders wrong. This catches that class of mistake instantly, entirely in your browser, before you go hunting through devtools to find it.
How to Use the HTML Validator
- 1
Paste the HTML: Enter the markup you want checked for tag-balance problems.
- 2
Read the Results Instantly: Any unclosed or mismatched tags are flagged automatically as you type.
- 3
Fix and Recheck: Adjust the flagged tag and watch the check update live.
How It Works
Tags are tracked with a stack as the markup is parsed: each opening tag is pushed on, and each closing tag must match whatever's on top of the stack or it's flagged as mismatched. Anything left on the stack once the input ends means a tag was opened but never closed. Void elements that never need a closing tag (`<br>`, `<img>`, `<hr>`, `<input>`, `<meta>`, `<link>`) are recognized and excluded from the check.
What It Catches
Structural nesting problems: an unclosed tag, or a closing tag that appears in the wrong order relative to what's open. Example of invalid input: <ul><li>Item one<li>Item two</ul>. Each `<li>` needs its own closing tag; without it, the second `<li>` opens before the first one closes, which this tool flags as an unclosed tag. What it won't catch: invalid attribute values, deprecated elements, or other full HTML5 spec-compliance issues. Only tag balance is checked, not markup validity as a whole.
Frequently Asked Questions
Common questions about HTML Validator.