A 400 Bad Request is an HTTP status code meaning the server received a request it could not parse or refused to process as sent. The problem is almost always on the client side: a malformed URL, an oversized header, an invalid character, or a stale cookie. The server is saying the message itself broke the rules before any content could be evaluated.

The default browser page for this code often reads “400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know.” That wording is a generic browser or proxy response, not a diagnosis. It means the receiving server rejected the request envelope, not that your device is compromised.

Mechanism: where the request dies

An HTTP request is a structured message. It carries a request line with method, path, and version. It carries headers as name-value pairs. It may carry a body whose length or encoding is declared. A 400 is generated when the server’s parser fails a check on that structure. Common triggers include an invalid percent-escape in the URL, a header name containing a space, a Content-Length that disagrees with the actual body, or an HTTP version token the server does not recognize.

The code is defined in the HTTP standards as a client error, grouped with 4xx responses. That grouping matters. A 4xx tells you the server believes the fault lies in the request, not in its own operation. Servers are permitted to return 400 for syntax failures and for semantic impossibilities they choose to reject. The status is broad by design, so the same code can mean a dozen different things depending on the stack.

One level deeper, the rejection usually happens in a parsing layer rather than an application layer. Web servers terminate connections and parse headers before routing to application code. Reverse proxies and content delivery networks may parse again, and each layer applies its own strictness. A request that passes one layer can fail the next. That is why an identical URL can return 400 from one route and 200 from another.

A useful mental model: the server never got to the question because the question was written illegibly. The 400 is the parser’s complaint, not the application’s answer.

How this code differs from nearby ones

The 4xx family splits syntax from semantics, and the distinction changes what you should fix. A 401 or 403 means the request was understood but authorization failed. A 404 means the resource was not found after a valid request. A 405 means the method is not allowed for a recognized resource. A 431 specifically flags headers too large. A 413 flags a payload too large. A 400 sits upstream of all of them as a general parse or validity failure.

Code Core meaning Typical fault First thing to check
400 Malformed or rejected request Client syntax or invalid input URL encoding, cookies, headers
401 Authentication required Missing or invalid credentials Sign-in state and tokens
403 Authenticated but forbidden Permission or policy Account role and access rules
404 Resource not found Wrong path or deleted item URL spelling and route
405 Method not allowed Wrong HTTP verb GET vs POST usage
413 Payload too large Oversized body Upload size limits
431 Headers too large Oversized headers Cookie count and size

Treating a 400 as a 404 or a 401 leads to wasted effort. You cannot log in your way past a parser error, and you cannot fix a permissions issue by clearing a cookie. Read the code first, then match the remedy to the layer.

Quantified context: limits and thresholds

Exact thresholds are server-specific, so treat numbers as ranges rather than universal law. Header size limits on common web servers commonly fall in the 4 KB to 16 KB range per header line or per request. Many stacks cap the total request-line length at 8 KB or less. Cookie bloat is a classic cause: a domain accumulates cookies over months, the Cookie header grows past a proxy limit, and requests start failing with 400 or 431 without any user action.

Percent-encoding is unforgiving. A raw space in a URL path is invalid; encoded as %20 it is valid. A stray % not followed by two hex digits is a parse error. A control character or null byte in a query string is rejected by most parsers. These are binary outcomes, not warnings, and they explain why a link that works in one app fails when pasted into another.

The code also has a long history. It appeared in the earliest HTTP specification lineage in the 1990s and was retained when HTTP/1.1 was standardized in 1999. Proxies have returned it for malformed traffic ever since. Millions of these errors occur daily simply because automated clients, bots, and link shorteners generate invalid requests. Most are invisible to humans because no one loads the page.

Edge cases: when the server is the problem

The counterintuitive professional caveat: a 400 does not guarantee the client is at fault. Well-behaved servers can emit 400 for conditions the client cannot see. Application-level validation often reuses the code for semantic failures, such as an invalid format in a submitted form field or a request missing a required parameter. In those cases the request was syntactically valid, and the code is being used as a general “bad input” signal.

Edge cases also arise from version mismatches. A server that does not support an HTTP/2 or HTTP/3 feature may reject a request carrying unusual pseudo-headers. Security appliances and web application firewalls sometimes drop suspicious-looking requests and return 400 rather than 403, deliberately obscuring why. A stale session cookie that no longer matches the server’s format can produce a 400 on every request until the cookie is cleared.

There is also a self-inflicted class of errors. Browser extensions and privacy tools modify headers or URLs, breaking encoding. Copy-pasted links from email clients introduce zero-width or smart-quote characters. Bookmarklets and old mobile apps send outdated request formats. Each produces the same terse error message.

Misconceptions that waste time

A frequent misconception is that a 400 means the site is down. It usually means the opposite: something received your request and actively rejected it. The site is responding, often quickly, which is why the error appears instead of a timeout.

Another is that clearing the browser cache fixes it. Cache clearing rarely helps, because a 400 is generated server-side from the request as received. Clearing cookies and checking the exact URL are more likely to expose the malformed part. Likewise, switching browsers only helps when the fault is browser-specific formatting, which is uncommon but not zero.

A third misconception is that the message “that’s all we know” reflects a server that refuses to help. That phrasing is a client-side hint, not server telemetry. The server never sent a body, so the browser had nothing to display. Nothing more was disclosed because nothing more was transmitted.

Practical actions with real thresholds

Work from the most likely cause outward, and stop when the error clears. The steps below are ordered by hit rate for ordinary users.

Clear cookies and site data for that domain only, then reload. If the error disappears, a stale cookie was the cause. Copy the URL into a plain-text editor and inspect it for spaces, smart quotes, stray percent signs, and non-English characters that were not encoded. Rebuild the link from the site’s own navigation instead of a bookmarked or emailed copy, which may carry stale parameters. Disable browser extensions or test in a private window. If the error vanishes, re-enable extensions one at a time. For file uploads, check the site’s stated size limit and file type. A rejected upload near the limit is a 400, not a 413, on some stacks.

If the error persists for every URL on the domain, including the homepage, the fault is more likely server-side configuration or a network appliance. Capture the exact timestamp, the URL, and the browser version, then contact the site’s support and report what you observed. Do not retry aggressively; repeated malformed attempts can trip rate limits or firewalls and extend the blockout.

For developers debugging the same condition, the workflow differs. Log the raw request at the edge, before any proxy rewrites it. Compare accepted and rejected requests byte for byte. Test whether the 400 originates from the proxy, the application framework, or a validation middleware. The origin determines the fix.

Timeline: how a request fails and recovers

Stage What happens Typical duration Signal you can observe
Request construction Client builds URL, headers, body Milliseconds Link or form source
Transmission Request crosses proxy or CDN Milliseconds Network tab shows sent request
Edge parsing Proxy checks syntax and size Sub-millisecond to seconds 400 from edge, no app logs
Origin parsing Server parses headers and line Milliseconds 400 with minimal body
Application validation Framework rejects input Milliseconds 400 with error detail, sometimes
Client retry User reloads or retries Seconds Same 400 repeats
Remediation Cookie or URL fix applied Minutes Successful 200 response

The table clarifies a key point: most 400s complete in less than a second. The error is fast and deterministic. A slow, intermittent failure is more likely a timeout or upstream problem dressed in a generic error page.

Limits of what this code tells you

The 400 status is intentionally thin. It does not identify the malformed field, the offending byte, or which layer rejected the request. Without server logs you cannot distinguish a firewall decision from an encoding error. That ambiguity is a design weakness of the code, and it is why the default message says so little.

Some platforms deliberately return 400 for requests they consider abusive, which blurs the line between “bad syntax” and “policy refusal.” Others use it for business-rule validation that has nothing to do with syntax. You cannot infer intent from the number alone. The only reliable method is controlled testing: change one variable, reload, and compare.

Finally, note the limit of this article itself. It explains the mechanism and general remediation of the HTTP status code. It does not diagnose a specific server, browser, or network configuration, and server behavior varies by implementation. If a 400 blocks access to something important, the site’s own support or your network administrator has information this article cannot supply.