Skip to main content

HTML Validator

New

Validate HTML structure for common errors, missing attributes, and accessibility issues.

htmlvalidatelintaccessibilitycheck
Read the guide
Shortcuts:⌘ KSearch

Frequently Asked Questions

What specific issues does the HTML Validator check for?

It checks for a missing <!DOCTYPE html>, a missing lang attribute on <html>, missing charset and viewport meta tags, images without alt text or with an empty src, empty href/src on any linked element, duplicate id attributes, invalid nesting (like a <p> inside a <p>, or a block element inside an inline one), and unclosed or mismatched tags.

Why do I need to click Validate instead of getting results as I type?

The validator runs a full tag-stack parse of the entire document (matching every opening tag to its closing tag) each time, which is intentionally triggered on demand rather than on every keystroke so large documents don't get re-parsed dozens of times while you're still mid-edit.

How are line numbers calculated for reported issues?

The validator locates the offending snippet in your raw source text and counts line breaks up to that point. For issues inside deeply nested or dynamically generated markup, the reported line is an estimate based on the first matching occurrence in the source.

Does this replace the W3C Nu HTML Checker?

No. This tool runs entirely client-side using the browser's built-in DOMParser plus a set of common accessibility and structural rules — it's designed for fast, private, offline checks during development, not full HTML5 spec conformance. For strict spec validation, pair it with the W3C validator before shipping.

Are duplicate IDs and unclosed tags treated as errors or warnings?

Duplicate IDs, unclosed tags, empty href/src values, and unexpected closing tags are reported as errors. Missing lang, charset, viewport, alt text, and questionable nesting are reported as warnings so you can triage the two severities separately.

Related Tools