We validated the top 5,000 websites. 87.2% break the HTML spec.
Between the Tranco top 5,000 domains, 2,656 served a home page we could read. We ran the same validators this site offers for free over every one of them and counted what came back: 100,305 HTML spec violations and 18,863 CSS errors, in 220 distinct message families. This is the full ranking.
Published August 11, 2026 · Updated August 14, 2026 with corrections · Free to cite with a link.
Key findings
What the numbers say
Valid HTML is the exception, not the rule. 87.2% of the most visited sites on the web violate the standard on their home page, leaving 12.8% with fully valid HTML. Hold them to best practices as well and only 2.6% survive. Those are two different bars and it is worth keeping them apart: the first is the standard, the second is the standard plus our opinions. Browsers are so good at error recovery that nothing forces anyone to fix either, which is exactly why it accumulates.
The distribution is brutally skewed. The median site has 11 errors, the mean 37.8, and the worst 1,392. Most sites have a handful of mistakes repeated a few times; a minority have one template bug repeated across every component on the page. If you are auditing a site, the count matters far less than the number of distinct rules broken. That is why our scores are computed per rule, not per occurrence.
The top failures are structural, not typos. The single most common finding is <X> element is not permitted as content under <X> (59.5% of sites). Nobody writes that by hand. It is what happens when components are composed by a framework that does not know which element it is being dropped into. It is a nesting problem created at build time, not in an editor.
Accessibility failures are near-universal. The findings that the Accessibility Checker keeps ( heading levels, unlabelled inputs, links with no text ) each appear on more than a third of sites. With the European Accessibility Act applicable since June 2025, that is a compliance surface, not a style preference.
CSS breaks in one place, not everywhere. 64.5% of sites have a CSS error but the median count is 1, and the most common one by far is Invalid value for `X` property. A stylesheet with a broken declaration still renders; the browser drops the line and moves on. That silence is the reason these survive in production for years.
The 25 most common HTML findings
Ranked by how many distinct sites emit the message, not by raw occurrences. One message repeated 4,000 times on a single site is still one site.
| # | Message family | Sites in family | Share |
|---|---|---|---|
| 1 | <style> element is not permitted as content under <div>1 of 256 wordings in this family. This exact one on 588 sites. | 1,579 | 59.5% |
| 2 | "type" attribute is unnecessary for javascript resources | 1,449 | 54.6% |
| 3 | <button> is missing recommended "type" attribute | 1,318 | 49.6% |
| 4 | Prefer to use the native <button> element1 of 20 wordings in this family. This exact one on 675 sites. | 1,116 | 42.0% |
| 5 | Anchor link must have a text describing its purpose | 1,008 | 38.0% |
| 6 | Landmarks must have a non-empty and unique accessible name (aria-label or aria-labelledby) | 919 | 34.6% |
| 7 | Initial heading level must be <h1> but got <h2>1 of 5 wordings in this family. This exact one on 458 sites. | 828 | 31.2% |
| 8 | <input> element does not have a <label>1 of 3 wordings in this family. This exact one on 740 sites. | 788 | 29.7% |
| 9 | Attribute "id" has invalid value ""1 of 830 wordings in this family. This exact one on 146 sites. | 775 | 29.2% |
| 10 | Redundant role "navigation" on <nav>1 of 38 wordings in this family. This exact one on 331 sites. | 753 | 28.4% |
| 11 | The <iframe> has no "title" attribute. It is valid HTML, but a screen reader announces the frame with no name, which fails WCAG 4.1.2. | 722 | 27.2% |
| 12 | Heading level can only increase by one, expected <h3> but got <h4>1 of 10 wordings in this family. This exact one on 265 sites. | 665 | 25.0% |
| 13 | Duplicate ID "Layer_1"1 of 2,119 wordings in this family. This exact one on 20 sites. | 617 | 23.2% |
| 14 | <button> must have accessible text | 586 | 22.1% |
| 15 | Attribute "frameborder" is deprecated on <iframe> element1 of 93 wordings in this family. This exact one on 135 sites. | 505 | 19.0% |
| 16 | <img> is missing required "alt" attribute1 of 2 wordings in this family. This exact one on 502 sites. | 503 | 18.9% |
| 17 | Class "w-full" duplicated1 of 992 wordings in this family. This exact one on 28 sites. best practice·no-dup-class | 450 | 16.9% |
| 18 | "aria-label" cannot be used on this element1 of 2 wordings in this family. This exact one on 351 sites. | 438 | 16.5% |
| 19 | Element references missing id "sac-autocomplete-results-container"1 of 1,788 wordings in this family. This exact one on 16 sites. | 433 | 16.3% |
| 20 | Prefer to use <button> instead of <input type="submit"> when adding buttons1 of 4 wordings in this family. This exact one on 373 sites. | 408 | 15.4% |
| 21 | <button> element is not permitted as a descendant of <a>1 of 33 wordings in this family. This exact one on 174 sites. | 357 | 13.4% |
| 22 | <form> element must have a submit button | 356 | 13.4% |
| 23 | title text cannot be longer than 70 charactersbest practice·long-title | 335 | 12.6% |
| 24 | Stray end tag '</p>'1 of 47 wordings in this family. This exact one on 94 sites. | 268 | 10.1% |
| 25 | <img> is missing required "src" attribute1 of 3 wordings in this family. This exact one on 250 sites. spec violation·element-required-attributes | 257 | 9.7% |
The 15 most common CSS findings
Every stylesheet a page links is validated separately, so a line number always refers to its own file.
| # | Message family | Sites in family | Share |
|---|---|---|---|
| 1 | Invalid value for `background-color` property1 of 218 wordings in this family. This exact one on 217 sites. | 1,330 | 50.1% |
| 2 | Unknown property `tap-highlight-color`1 of 1,222 wordings in this family. This exact one on 52 sites. | 433 | 16.3% |
| 3 | Unknown at-rule `@if`1 of 18 wordings in this family. This exact one on 82 sites. | 121 | 4.6% |
| 4 | Unexpected end of input | 85 | 3.2% |
| 5 | Invalid value for `src` descriptor1 of 10 wordings in this family. This exact one on 24 sites. | 72 | 2.7% |
| 6 | Unexpected token Semicolon | 61 | 2.3% |
| 7 | Unknown at-rule descriptor `font-named-instance`1 of 18 wordings in this family. This exact one on 11 sites. | 35 | 1.3% |
| 8 | Invalid value for `@media` prelude1 of 6 wordings in this family. This exact one on 22 sites. | 31 | 1.2% |
| 9 | Invalid empty selectorspec violation·SyntaxError | 25 | 0.9% |
| 10 | Unexpected token Ident("padding-top")1 of 14 wordings in this family. This exact one on 2 sites. | 13 | 0.5% |
| 11 | Unexpected token Delim('*') | 8 | 0.3% |
| 12 | Unexpected token Delim('!') | 8 | 0.3% |
| 13 | Invalid dangling combinator in selectorspec violation·SyntaxError | 6 | 0.2% |
| 14 | Unexpected token AtKeyword("media") | 5 | 0.2% |
| 15 | Pseudo-elements like '::before' or '::after' can't be followed by selectors like 'Delim('.')'spec violation·SyntaxError | 4 | 0.2% |
How we measured it
We took the Tranco top 5,000 from the Tranco list , a research ranking that averages several popularity lists to resist manipulation, and requested the home page of each domain over HTTPS in August 2026.
Each page went through the same public endpoints this site runs for its users: HTML through html-validate on its standard preset, CSS through csstree-validator with lightningcss adjudicating modern syntax. Driving the real API rather than the engines means every false-positive filter we ship applied here too, so these counts are what a user of the tool actually sees.
Severity is not a style choice. We count as an error only what violates the written HTML standard. Opinions that are still valid HTML, such as an inline style or a missing type on a button, are counted separately as best practiceand are labelled as such in the tables above. Many published “error” statistics conflate the two, which roughly triples the headline.
Messages are grouped into families by masking their variable parts, so Unknown property `colr` and Unknown property `bakground`count as one problem. The wording shown in each row is the family’s most widespread member, measured in sites like everything else, and each row states how many sites that exact wording reaches so it is never mistaken for the family total.
2,344 of the 5,000 domains produced no measurement and are excluded from every percentage on this page. A large share of the top of the list is infrastructure: CDN and DNS hostnames that were never meant to serve a page. The reasons:
- 1,471Could not reach the URL. Check that it is valid and accessib
- 441Failed to fetch: … Forbidden
- 248Response too large (max NKB)
- 80Failed to fetch: … Not Found
- 24No HTML content provided
And we ran it on ourselves. Every page of this site, all 104 of them including the one you are reading, validates at zero errors and zero warnings against the engine above. Writing this study is what made us check; it found four problems we then fixed. Publishing a number you have not applied to your own site is not research, it is marketing.
What this study cannot tell you
Home pages only. One page per domain, and the page a company polishes most. Checkout flows, dashboards and CMS-generated article pages are almost certainly worse, and nothing here measures them.
Popular sites only. The Tranco top 5,000 is large teams and mature stacks. It is not a sample of the web, and it is not a sample of the sites most developers work on.
HTML and CSS only. No JSON, no XML, no robots.txt. Those are things people paste into a validator, not things a home page emits, so a crawl cannot see them at all.
Our engines’ judgement. Any validator encodes decisions about what to report. Ours are documented and deliberately conservative: we drop findings we cannot trust rather than pad a count. But a different tool would produce a different ranking. That is a reason to compare, not to average.
A snapshot. Measured August 14, 2026. Sites change; this page states its date for that reason.
And an open gap. 129 of the 220 families have no fix guide on this site yet, the largest being Class "w-full" duplicated at 16.9% of sites. We write them in the order this ranking gives.
Corrections
August 14, 2026: a frame named with ARIA was still being counted as unnamed.
WCAG asks for an accessible name, not for one particular attribute. An aria-label, or an aria-labelledby pointing at real text, names an <iframe> as well as title does. Our engine only knew about title, so it reported frames that were correctly labelled, on the most common accessibility finding in this study. The mirror of the same gap: a frame carrying title="" has no name either, and was reported by nobody. Both are fixed, and the frame figure moves from 27.4% to 27.2% of sites. The headline moves from 87.4% to 87.2%, which is crawl-to-crawl variation rather than the fix: these findings are warnings and never counted toward it.
August 13, 2026: three rules were counted as spec violations that the HTML standard does not require.
Our validator inherited element metadata that marks title as required on <iframe> and lang as required on <html>. Neither is required by the written standard. Both are WCAG obligations, and the W3C’s own validator phrases the second as a suggestion. A third, imagesizes on a preload link, is required only when the source set uses width descriptors, and was demanded whenever the attribute imagesrcset appeared at all.
This mattered more than its size suggests. The <iframe> rule alone fired on 27.5% of the sample and was the single most common HTML finding in the first edition, so a rule that does not belong in the error column was setting the shape of the whole ranking. The first edition reported 90.5% of sites breaking the spec and 2.6% completely clean; the corrected crawl reported 87.4% and 2.6%. The three findings did not disappear: they are warnings now, and the two accessibility ones are reported by the Accessibility Checker, which had been missing them entirely.
Two presentation errors from the same review. Each table row is a family of wordings, and the row showed only its most common member next to the family’s share, which reads as a claim about that one message. Rows now say how far the example itself reaches. And the headline figure quoted when this study was first shared was the 2.6% one, which requires zero best-practice warnings as well as zero errors. The share with fully valid HTML is the larger number, and both are now stated side by side above.
The first of these was found by readers on Hacker News after publication, the second by writing the fix guide for the first. The corpus is re-crawled on the corrected rules each time rather than adjusted after the fact, so every figure on this page comes from one run of one build.
Every error we measured, with a fix
Percentage of the 2,656 sites tested that hit each one.
HTML
- 61.6%incorrect nesting
- 54.6%redundant script type
- 49.6%button missing type
- 48.6%native element instead of role
- 46.5%heading level skip
- 42.7%missing form label
- 29.7%invalid attribute value
- 28.4%redundant aria role
- 23.2%duplicate id
- 19.0%deprecated attribute
- 19.0%missing alt attribute
- 16.1%unclosed tag
- 9.5%missing lang attribute
- 8.4%empty heading
- 6.3%deprecated element
- 2.3%missing title
- 2.3%missing doctype
CSS
- 51.2%invalid property value
- 16.3%unknown property
- 7.1%unclosed bracket
- 5.8%media query syntax
Accessibility
- 46.5%skipped heading level
- 42.7%missing form labels
- 41.6%missing aria label
- 38.0%empty link text
- 27.2%iframe missing title
- 22.1%empty button text
- 20.4%missing alt text
- 13.4%missing button type
- 9.5%missing lang attribute
- 8.4%empty heading
- 0.8%missing table headers
Citing this study
Free to quote, chart or republish with a link back. Suggested wording:
ValidateHTML, “HTML & CSS Error Statistics: We Validated the Top 5,000 Websites” (2026). Validation of 2,656 home pages from the Tranco top 5,000. validatehtml.com/html-error-statistics
Questions about the method, or want a cut of the data we did not publish? Ask us.
Where does your site sit?
Same validators, same rules, on your URL. Free, no signup, results in seconds.