Skip to content
🧪

HTML Validator

Find markup errors, warnings, and missing document essentials on any page.

Uses our server

Updated

Parsed, then checked against five rules

The page is fetched and handed to the HTML parser bundled with PHP, which reports back on everything it had to repair. Messages are capped at 25, and the parser's fatal and error levels are both counted as errors while everything else counts as a warning. Alongside those messages the tool grades five essentials: a doctype, a lang attribute on the html element, a non-empty title, exactly one H1, and alt text on every image.

A worked example

A 334-byte page with a doctype, lang="en-GB", a 39 character title, one H1, two images both with alt text, and one section element reports one error and no warnings: "Tag section invalid" at line 9. All five checks pass, so the summary reads 1 error while every row is green. The parser predates HTML5, which is why a perfectly ordinary section is flagged.

What the checks mean

  1. Doctype: a missing one drops browsers into quirks mode.
  2. Language: without it a screen reader guesses the pronunciation.
  3. Title: printed back to 70 characters for a quick read.
  4. H1: exactly one is the convention, and the count is shown either way.
  5. Alt text: counted by the presence of the attribute, so alt="" passes.

Where it stops

  • This is a parser report, not conformance to the HTML standard, so valid modern markup is flagged as invalid.
  • Only the first 25 parser messages are kept.
  • Duplicate IDs, unclosed inline tags and ARIA misuse are not detected.
  • Nothing is checked inside linked CSS or JavaScript.

Questions people ask

Why is a valid HTML5 element reported as an error?

Because the parser only knows the older element set. Tags such as main, section and picture are treated as unknown, and the message ends up in the error count rather than the warning count. Treat those lines as noise and read the rest of the list.

How can the markup be tidied first?

Run it through the HTML beautifier to make indentation and nesting visible, then re-check. To shrink the same file before publishing, the HTML minifier removes whitespace between tags.