HTTP status · 4xx — client error
400 Bad Request
400 Bad Request means the server cannot process the request because the client sent something malformed.
Key facts
| Class | 4xx — client error |
|---|---|
| Standard | RFC 9110 §15.5.1 |
| Cacheable by default | No |
| Typical causes | Malformed JSON, bad encoding, invalid header |
| Fix side | Client or caller |
What 400 means
The server received a request it cannot parse or that violates the protocol: broken JSON, an invalid Content-Length, a header with illegal characters, or a URL that cannot be decoded. The problem is on the request side, so retrying the same request unchanged will fail the same way.
Common causes and fixes
- Malformed JSON: validate the payload with a JSON formatter before sending; check for trailing commas and unescaped quotes.
- Wrong Content-Type: sending form data as JSON or JSON as form data makes the server parse the wrong grammar.
- Bad URL encoding: spaces and non-ASCII characters must be percent-encoded.
- Header issues: an invalid
Host, duplicatedContent-Lengthor oversized cookie can trigger 400 at a proxy before your app sees it.
Frequently asked questions
Is 400 the client's fault?
It means the request is malformed from the server's point of view. That is usually the caller's bug, but a proxy or an outdated client can also produce it.
What is the difference between 400 and 422?
400 says the request could not be parsed. 422 says it parsed correctly but failed semantic validation, such as a missing required field.