Code Tools

HTML Validator

All tools

Catch unclosed and mismatched tags in a snippet before they break the layout of a whole page.

How it works

Four simple steps

1

Paste the HTML

Add a fragment or a full document to the input panel.

2

Tags are matched

Opening and closing tags are paired using a stack as you type.

3

Read the report

Unclosed, unexpected and mismatched tags are listed by name.

4

Fix and recheck

Edit the input until the report says the structure is valid.

HTML Validator

About HTML Validator

A CMS block renders fine on its own, but once it is dropped into the page the sidebar ends up inside the footer. Nine times out of ten that is a missing closing div, and a tag-balance check finds it in seconds.

The validator walks every tag in order and keeps a stack of open elements. It reports a closing tag with nothing open, a closing tag that does not match the most recent opening tag (for example, Expected </p> but found </div>), and any element still open at the end. Void elements such as img, br, input and meta are understood, comments are skipped, and self-closing syntax is accepted. Two accessibility warnings are added: <img> without an alt attribute and <a> without href. The report refreshes as you type.

This is a lightweight client-side check, not the W3C or WHATWG validator. It knows nothing about allowed nesting, attribute values or implied end tags, so markup that legally omits </li> or </p> is reported as unclosed. Read those results as hints. An indented copy of the markup makes a reported tag easy to locate, and you can count each element type to see what the browser parser found. For head tags specifically, the meta tag analyzer goes deeper.

Checks are pattern based and run inside the page; the markup is neither rendered nor uploaded during validation.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

HTML lets you omit some closing tags, and browsers fill them in. This checker expects every non-void element to be closed explicitly, so it flags those cases. Adding the closing tags is harmless and clears the report.

No. Messages name the tags involved, such as Unclosed

. Search your source for that tag, or format the markup first so the nesting is visible.

No. Paste the HTML source instead. View Source in any browser gives you the full document to copy.

View more FAQs

Related tools

View all

HTML Formatter

Beautify and indent HTML markup.

Open

CSS Formatter

Format and pretty-print CSS.

Open

JS Formatter

Beautify JavaScript code.

Open

JSON Formatter

Beautify and validate JSON.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools