Validate HTML

Check HTML for conformance errors, invalid nesting, duplicate attributes, and malformed references.

freeworks offlinenothing uploaded
ToolHTML Validator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Markup is parsed with the HTML tokenizer and tree builder, then checked for duplicate attributes, nesting, required relationships, obsolete elements, and malformed URLs or ids. Browser recovery is separated from authoring warnings.

  • Parsing matches browser behavior.
  • Conformance findings expose errors browsers may silently repair.

Worked example

Check for common HTML errors
Detect unclosed tags and missing alt attributes in HTML
Input
											<div><p>Hello</div><img src="photo.jpg">
										
Output
												Found 1 error(s)
1 warning(s)

Errors:
  - Line 1: Unclosed tag <p>

Warnings:
  - Line 1: <img> tag missing alt attribute
											

When to use this

Template CI, accessibility reviews, and generated-page checks validate HTML.

Edge cases

  • Duplicate attributes can be ignored but remain errors.
  • A block element can implicitly close a p.
  • Spaces in an id are invalid despite browser recovery.

References