HTML Validator screenshot

HTML Validator

Check whether HTML tags are balanced, with the line that breaks it. Optional end tags are legal, not errors.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Instant
No signup

What validating HTML checks

Tags are matched on the token stream, so a < character inside a script body cannot confuse it. An end tag that closes nothing, or one that arrives while a different element is still open, is reported with its line number. The tags a document may legally leave out — , , , and their neighbours — are counted as recovered rather than reported, because reporting them would flag almost every real page. This checks structure only: whether elements are allowed to nest, and whether attributes are valid, is a different and much larger question.

How to use it

HTML Validator: paste the HTML into the box above, and press Run to get the validation result below.

Worked example

Input:

<!DOCTYPE html>
<html lang="en">
  <head><title>AllTools</title></head>
  <body>
    <ul><li>one<li>two</ul>
    <p>Hello <b>world</b></p>
  </body>
</html>

Output:

Well-formed: every element that needs an end tag has one.

Elements: 9
Maximum depth: 4
Optional end tags recovered: 2

This checks tag structure. It does not check that elements are allowed
to nest, that attributes are valid, or that the document follows a
schema.

Why it runs in your browser

The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads HTML and returns validation result; reloading the page discards both.

Tags are matched on the token stream, so a < character inside a script body cannot confuse it. An end tag that closes nothing, or one that arrives while a different element is still open, is reported with its line number. The tags a document may legally leave out — <p>, <li>, <td>, <option> and their neighbours — are counted as recovered rather than reported, because reporting them would flag almost every real page. This checks structure only: whether elements are allowed to nest, and whether attributes are valid, is a different and much larger question.

Check whether HTML tags are balanced, with the line that breaks it. Optional end tags are legal, not errors.

How to use it

HTML Validator: paste the HTML into the box above, and press Run to get the validation result below.

Why it runs in your browser

The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads HTML and returns validation result; reloading the page discards both.

What to Expect

Best for

  • Converting HTML to validation result when the data is already on screen.

What this tool keeps

  • Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.

Sample input

<!DOCTYPE html> <html lang="en"> <head><title>AllTools</title></head> <body> <ul><li>one<li>two</ul> <p>Hello <b>world</b></p> </body> </html>

Sample output

Well-formed: every element that needs an end tag has one. Elements: 9 Maximum depth: 4 Optional end tags recovered: 2 This checks tag structure. It does not check that elements are allowed to nest, that attributes are valid, or that the document follows a schema.

Frequently asked questions

How do I use the html validator?

HTML Validator: paste the HTML into the box above, and press Run to get the validation result below.

Is my input uploaded?

No. The text is parsed on this page with JavaScript and is never posted to a server.

Is there a size limit?

Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.