HTML Tester
Test HTML for unclosed or mismatched tags with a live, sandboxed preview.
Every tag looks properly opened and closed.
Checks that tags are balanced and renders a live, sandboxed preview that never executes scripts — pasting HTML from an untrusted source is safe. This is a structural check, not a full HTML5 spec validator. Everything runs in your browser; nothing you type is sent anywhere.
Need the opposite? HTML Validator
What is HTML Tester?
Paste HTML and this tool checks that every tag is properly opened and closed, flags any mismatches, and renders a live preview in a sandboxed frame that never executes scripts. Useful for quickly spotting a stray unclosed <div> before it breaks a page's layout.
How to Use the HTML Tester
- 1
Paste the HTML: Enter the markup you want to preview and check.
- 2
Review the Sandboxed Preview: A live preview renders automatically with scripts disabled.
- 3
Check for Flagged Tags: Any unclosed or mismatched tags are flagged alongside the preview.
How It Works
Tags are tracked with a stack as the markup is parsed: every opening tag pushes onto it, and every closing tag must match the tag on top of the stack or it's flagged as a mismatch. A tag still left on the stack at the end of the input means it was never closed. Self-closing/void elements (like `<br>`, `<img>`, `<hr>`, `<input>`) are recognized and skipped, since they don't require a closing tag. The preview itself renders in a sandboxed iframe with scripts disabled, so the markup can be viewed safely even if it's untrusted.
Example
<div><span></div></span>- Found a closing </span> with no matching opening tag.
The `<div>` and `<span>` close in the wrong order, so the closing `</span>` has nothing on the stack to match.
What It Catches
Unclosed tags (an opening tag with no matching close before the input ends), and mismatched tags (a closing tag that doesn't correspond to the most recently opened one, like `<div><span></div></span>`). It does not check attribute validity, deprecated elements, or full HTML5 spec compliance, only structural tag balance.
Frequently Asked Questions
Common questions about HTML Tester.