HTML Guides for 400
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
A resource referenced in the HTML cannot be fetched because the server returned an HTTP 400 (Bad Request) status code.
This error appears when the W3C validator tries to retrieve a URL specified in your HTML and the remote server rejects the request. The validator follows URLs found in attributes like src, href, or action to check that referenced resources exist and are accessible. A 400 response means the server considered the request malformed or invalid.
Common causes include:
- A typo or malformed URL in an attribute value
- Unencoded special characters in the URL (spaces, angle brackets, curly braces)
- A URL that contains template placeholders like
{{variable}}or{id}that were never replaced with actual values - A URL pointing to a localhost or internal resource the validator cannot reach
- A URL scheme mismatch, such as using
http://when the server only acceptshttps://
The validator reports this as an informational warning rather than a strict HTML syntax error, but it signals that something about the URL is wrong or unreachable.
Example with the issue
<imgsrc="https://example.com/images/photo one.jpg"alt="A photo">
<linkrel="stylesheet"href="https://example.com/styles/main.css?v={{version}}">
The first URL has an unencoded space. The second contains a template placeholder that was never resolved, which the remote server rejects.
Fixed example
<imgsrc="https://example.com/images/photo%20one.jpg"alt="A photo">
<linkrel="stylesheet"href="https://example.com/styles/main.css?v=2.1.0">
Spaces are percent-encoded as %20, and the template placeholder is replaced with an actual value. If the URL points to an internal or private resource that the validator simply cannot access, the warning can be safely ignored, but verify the URL works in a browser first.
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries