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

Hacker News Top News

Summary

An analysis of the top 5,000 websites reveals that 90.5% have at least one HTML error, only 2.6% are fully valid, and accessibility failures are widespread.

No content available
Original Article
View Cached Full Text

Cached at: 08/12/26, 02:20 PM

# HTML & CSS Error Statistics: We Validated the Top 5,000 Websites Source: [https://validatehtml.com/html-error-statistics](https://validatehtml.com/html-error-statistics) Original research Between theTranco top 5,000domains,2,655served 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,399HTML spec violations and17,599CSS errors, in220distinct message families\. This is the full ranking\. PublishedAugust 11, 2026· Free to cite with a link\. ## Key findings 90\.5% of sites have at least one HTML error 2,402 of 2,655 sites\. Not warnings, but violations of the written standard\. 2\.6% are completely clean Only 69 sites returned zero errors and zero best\-practice warnings\. 12 errors on the median site The mean is 37\.8 and the worst site had 2,209\. A small tail carries most of the damage\. 65\.1% of sites have a CSS error Measured on 2,471 sites, across every stylesheet the page links\. 1 CSS errors on the median site CSS fails differently: most sites have one bad declaration, not hundreds\. The mean is 7\.1\. 220 distinct message families 187 of them are spec violations\. The whole web's markup fails in a countable number of ways\. ## What the numbers say **Valid HTML is the exception, not the rule\.**Nine sites in ten among the most visited on the web violate the standard on their home page, and2\.6% come back completely clean\. Browsers are so good at error recovery that nothing forces anyone to fix this, which is exactly why it accumulates\. **The distribution is brutally skewed\.**The median site has12errors, the mean37\.8, and the worst2,209\. 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](https://validatehtml.com/html-errors/incorrect-nesting)created at build time, not in an editor\. **Accessibility failures are near\-universal\.**The findings that the[Accessibility Checker](https://validatehtml.com/accessibility-checker)keeps \([heading levels](https://validatehtml.com/accessibility-errors/skipped-heading-level),[unlabelled inputs](https://validatehtml.com/accessibility-errors/missing-form-labels),[links with no text](https://validatehtml.com/accessibility-errors/empty-link-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\.**65\.1% of sites have a CSS error but the median count is1, 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\. \#MessageSitesShare1`<style\> element is not permitted as content under <div\>`spec violation·element\-permitted\-content·[how to fix](https://validatehtml.com/html-errors/incorrect-nesting) 1,58159\.5%2`"type" attribute is unnecessary for javascript resources`best practice·script\-type·[how to fix](https://validatehtml.com/html-errors/redundant-script-type) 1,45254\.7%3`<button\> is missing recommended "type" attribute`best practice·no\-implicit\-button\-type·[how to fix](https://validatehtml.com/html-errors/button-missing-type) 1,31649\.6%4`Prefer to use the native <button\> element`best practice·prefer\-native\-element·[how to fix](https://validatehtml.com/html-errors/native-element-instead-of-role) 1,10741\.7%5`<img\> is missing required "src" attribute`spec violation·element\-required\-attributes 1,09341\.2%6`Anchor link must have a text describing its purpose`best practice·wcag/h30·[how to fix](https://validatehtml.com/accessibility-errors/empty-link-text) 1,00137\.7%7`Landmarks must have a non\-empty and unique accessible name \(aria\-label or aria\-labelledby\)`best practice·unique\-landmark·[how to fix](https://validatehtml.com/accessibility-errors/missing-aria-label) 91834\.6%8`Initial heading level must be <h1\> but got <h2\>`best practice·heading\-level·[how to fix](https://validatehtml.com/html-errors/heading-level-skip) 82331\.0%9`<input\> element does not have a <label\>`best practice·input\-missing\-label·[how to fix](https://validatehtml.com/html-errors/missing-form-label) 79730\.0%10`Attribute "target" has invalid value ""`spec violation·attribute\-allowed\-values·[how to fix](https://validatehtml.com/html-errors/invalid-attribute-value) 77829\.3%11`Redundant role "link" on <a\>`best practice·no\-redundant\-role·[how to fix](https://validatehtml.com/html-errors/redundant-aria-role) 74828\.2%12`Heading level can only increase by one, expected <h3\> but got <h4\>`best practice·heading\-level·[how to fix](https://validatehtml.com/html-errors/heading-level-skip) 66825\.2%13`Duplicate ID "porb"`spec violation·no\-dup\-id·[how to fix](https://validatehtml.com/html-errors/duplicate-id) 62123\.4%14`<button\> must have accessible text`best practice·text\-content·[how to fix](https://validatehtml.com/accessibility-errors/empty-button-text) 58922\.2%15`Attribute "name" is deprecated on <a\> element`spec violation·no\-deprecated\-attr·[how to fix](https://validatehtml.com/html-errors/deprecated-attribute) 51219\.3%16`<img\> is missing required "alt" attribute`spec violation·wcag/h37·[how to fix](https://validatehtml.com/html-errors/missing-alt-attribute) 50719\.1%17`Class "\]\[" duplicated`best practice·no\-dup\-class 44716\.8%18`Element references missing id "Browse"`spec violation·no\-missing\-references·[how to fix](https://validatehtml.com/html-errors/missing-form-label) 43216\.3%19`"aria\-label" cannot be used on this element`spec violation·aria\-label\-misuse·[how to fix](https://validatehtml.com/accessibility-errors/missing-aria-label) 42816\.1%20`Prefer to use <button\> instead of <input type="submit"\> when adding buttons`best practice·prefer\-button·[how to fix](https://validatehtml.com/html-errors/native-element-instead-of-role) 40915\.4%21`<form\> element must have a submit button`best practice·wcag/h32·[how to fix](https://validatehtml.com/accessibility-errors/missing-button-type) 35713\.4%22`<a\> element is not permitted as a descendant of <a\>`spec violation·element\-permitted\-content·[how to fix](https://validatehtml.com/html-errors/incorrect-nesting) 33912\.8%23`title text cannot be longer than 70 characters`best practice·long\-title 33312\.5%24`Stray end tag '</p\>'`spec violation·close\-order·[how to fix](https://validatehtml.com/html-errors/unclosed-tag) 26810\.1%25`Unclosed element '<div\>'`spec violation·close\-order·[how to fix](https://validatehtml.com/html-errors/unclosed-tag) 2298\.6% ## The 15 most common CSS findings Every stylesheet a page links is validated separately, so a line number always refers to its own file\. \#MessageSitesShare1`Invalid value for \`transition\-delay\` property`spec violation·SyntaxMatchError·[how to fix](https://validatehtml.com/css-errors/invalid-property-value) 1,34150\.5%2`Unknown property \`font\-smoothing\``spec violation·SyntaxReferenceError·[how to fix](https://validatehtml.com/css-errors/unknown-property) 43616\.4%3`Unknown at\-rule \`@if\``spec violation·SyntaxReferenceError·[how to fix](https://validatehtml.com/css-errors/media-query-syntax) 1234\.6%4`Unexpected end of input`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 863\.2%5`Invalid value for \`src\` descriptor`spec violation·SyntaxMatchError·[how to fix](https://validatehtml.com/css-errors/invalid-property-value) 712\.7%6`Unexpected token Semicolon`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 622\.3%7`Unknown at\-rule descriptor \`font\-named\-instance\``spec violation·SyntaxReferenceError·[how to fix](https://validatehtml.com/css-errors/media-query-syntax) 361\.4%8`Invalid value for \`@media\` prelude`spec violation·SyntaxMatchError·[how to fix](https://validatehtml.com/css-errors/invalid-property-value) 301\.1%9`Invalid empty selector`spec violation·SyntaxError 220\.8%10`Unexpected token Ident\("padding\-top"\)`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 130\.5%11`Unexpected token Delim\('\!'\)`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 80\.3%12`Unexpected token Delim\('\*'\)`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 70\.3%13`Invalid dangling combinator in selector`spec violation·SyntaxError 70\.3%14`Unexpected token AtKeyword\("media"\)`spec violation·SyntaxError·[how to fix](https://validatehtml.com/css-errors/unclosed-bracket) 50\.2%15`Pseudo\-elements like '::before' or '::after' can't be followed by selectors like 'Delim\('\.'\)'`spec violation·SyntaxError 40\.2% ## How we measured it We took theTranco top 5,000from the[Tranco list](https://tranco-list.eu/), a research ranking that averages several popularity lists to resist manipulation, and requested the home page of each domain over HTTPS inAugust 2026\. Each page went through the same public endpoints this site runs for its users: HTML through[html\-validate](https://html-validate.org/)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 anerroronly 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 asbest 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 exact wording shown in each row is the most frequent variant\. 2,345of the5,000domains 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,479Could not reach the URL\. Check that it is valid and accessib - 433Failed to fetch: … Forbidden - 248Response too large \(max NKB\) - 81Failed to fetch: … Not Found - 21No HTML content provided **And we ran it on ourselves\.**Every page of this site, all102of 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\.**MeasuredAugust 11, 2026\. Sites change; this page states its date for that reason\. **And an open gap\.**132of the220families have no fix guide on this site yet, the largest being`<img\> is missing required "src" attribute`at41\.2% of sites\. We write them in the order this ranking gives\. ## Every error we measured, with a fix Percentage of the2,655sites tested that hit each one\. ### HTML - 61\.7%[incorrect nesting](https://validatehtml.com/html-errors/incorrect-nesting) - 54\.7%[redundant script type](https://validatehtml.com/html-errors/redundant-script-type) - 49\.6%[button missing type](https://validatehtml.com/html-errors/button-missing-type) - 48\.4%[native element instead of role](https://validatehtml.com/html-errors/native-element-instead-of-role) - 46\.4%[heading level skip](https://validatehtml.com/html-errors/heading-level-skip) - 43\.0%[missing form label](https://validatehtml.com/html-errors/missing-form-label) - 29\.9%[invalid attribute value](https://validatehtml.com/html-errors/invalid-attribute-value) - 28\.2%[redundant aria role](https://validatehtml.com/html-errors/redundant-aria-role) - 23\.4%[duplicate id](https://validatehtml.com/html-errors/duplicate-id) - 19\.3%[deprecated attribute](https://validatehtml.com/html-errors/deprecated-attribute) - 19\.2%[missing alt attribute](https://validatehtml.com/html-errors/missing-alt-attribute) - 16\.0%[unclosed tag](https://validatehtml.com/html-errors/unclosed-tag) - 9\.7%[missing lang attribute](https://validatehtml.com/html-errors/missing-lang-attribute) - 7\.9%[empty heading](https://validatehtml.com/html-errors/empty-heading) - 6\.3%[deprecated element](https://validatehtml.com/html-errors/deprecated-element) - 2\.3%[missing title](https://validatehtml.com/html-errors/missing-title) - 2\.2%[missing doctype](https://validatehtml.com/html-errors/missing-doctype) ### CSS - 51\.6%[invalid property value](https://validatehtml.com/css-errors/invalid-property-value) - 16\.4%[unknown property](https://validatehtml.com/css-errors/unknown-property) - 7\.2%[unclosed bracket](https://validatehtml.com/css-errors/unclosed-bracket) - 6\.0%[media query syntax](https://validatehtml.com/css-errors/media-query-syntax) ### Accessibility - 46\.4%[skipped heading level](https://validatehtml.com/accessibility-errors/skipped-heading-level) - 43\.0%[missing form labels](https://validatehtml.com/accessibility-errors/missing-form-labels) - 41\.3%[missing aria label](https://validatehtml.com/accessibility-errors/missing-aria-label) - 37\.7%[empty link text](https://validatehtml.com/accessibility-errors/empty-link-text) - 22\.2%[empty button text](https://validatehtml.com/accessibility-errors/empty-button-text) - 20\.6%[missing alt text](https://validatehtml.com/accessibility-errors/missing-alt-text) - 13\.4%[missing button type](https://validatehtml.com/accessibility-errors/missing-button-type) - 7\.9%[empty heading](https://validatehtml.com/accessibility-errors/empty-heading) - 0\.8%[missing table headers](https://validatehtml.com/accessibility-errors/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 of2,655home pages from theTranco 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](https://validatehtml.com/contact)\. ## Where does your site sit? Same validators, same rules, on your URL\. Free, no signup, results in seconds\.

Similar Articles

Show HN: 92% of US city websites fail ADA accessibility

Hacker News Top

A study by AccessLumens found that 42% of US city websites still have critical accessibility barriers after the ADA Title II deadline, with an average score of 93 out of 100 but significant failures in key criteria. The choice of CMS vendor strongly correlates with accessibility risk.

Website checklist

Lobsters Hottest

A comprehensive checklist for building modern websites covering HTML fundamentals, SEO, accessibility, and more, sourced from the Website Specification.

The unreasonable effectiveness of simple HTML

Hacker News Top

A blog post arguing for the continued relevance of simple HTML for universal accessibility, illustrated by a story of a woman using a PSP browser to access government services.

98% Isn't Much

Hacker News Top

An article arguing that 98% browser support is insufficient for robust engineering, highlighting how edge cases affect millions of users and why graceful degradation matters.