Only 2.6% of the Web's Top Sites Have Valid HTML

Only 2.6% of the most visited websites have fully valid HTML

Only 2.6% of the Web's Top Sites Have Valid HTML

A study of the top 5,000 websites found that 90.5% have at least one HTML error, with a median of 12 errors per site. Only 2.6% are completely clean. The most common issues are structural nesting problems and accessibility failures, while CSS errors are less frequent but still affect 65.1% of sites. The research highlights that browsers' error recovery masks these issues, allowing them to persist.

Browsers are so good at error recovery that nothing forces anyone to fix this, which is exactly why it accumulates.
  1. jerf

    To a first approximation, this doesn't matter anymore. "Valid HTML" used to be a big deal because when you left the HTML spec you were inviting the various browsers to interpret your non-standard HTML in differing ways, sometimes quite catastrophically so for the styling or how the Javascript would interact with the page.

    This is no longer anywhere near as important as it used to be because HTML5 defines a method for turning more-or-less any sequence of bytes into the same DOM tree: https://dev.w3.org/html5/spec-LC/parsing.html And that's only the beginning of the process. I can't seem to find a good link to the whole 8.2 section of the HTML5 spec but the whole process is freaking huge. But it's defined now.

    I hedge on the "more-or-less" because I'm sure there are still bugs in various parsers and perhaps there are pathological sequences that wouldn't be handled by this process, but such sequences would be very, very distant from being HTML at all. But one difference with HTML5 is that the parsers would be considered buggy; in previous versions it could be debatable what the parser should do. HTML5 should fully specify that. If it doesn't that is now a bug in the spec. I would hope it has been banged on enough at this point that any possible remaining corner cases must be pretty small by now.

    It is in my considered opinion perfectly sensible to define "HTML" as "what comes out of the HTML5 parsing process" and not really be all that worried about whether this tag does or does […]

  2. alt227

    This is exactly why HTML is so ubiquitous, because it is so tolerant of mistakes in formatting, syntax, and just about anything else.

    Most browsers will even read and process most of the things listed on this page because even if the spec doesnt say so, it just makes sense to anyway.

  3. INTPenis

    As someone who valued that "Validated by w3c" button on my website back in the day, if a website today has FULLY valid HTML, I gaurantee you the admin is a massive nerd.

  4. account42

    The claim in the title does not match the linked website. The 2.6% figure only includes websites that also follow some arbitrary set of "best practices" in addition to being valid HTML, some of which actually contradict best practices from the past.

  5. teo_zero

    > An unclosed tag occurs when an opening HTML tag like <div>, <p>, or <span> is missing its corresponding closing tag.

    Since when does <p> requires a closing tag? Note that TFA lists this among "spec violations" and not merely "best practices".

More from this day

2026-08-12