400 vs 422: Bad Request vs Unprocessable Content
400 means the request couldn’t be parsed or is structurally invalid. 422 means it parsed fine but the data fails validation rules.
400
HTTP 400 Bad Request
The server could not understand the request because its syntax, headers or body are malformed or invalid.
Causes & fixes →
422
HTTP 422 Unprocessable Content
The request is well-formed, but the data fails validation (e.g. invalid email, missing required field).
Causes & fixes →| 400 | 422 | |
|---|---|---|
| Syntax | Broken (invalid JSON, bad headers) | Valid |
| Semantics | — | Invalid (bad email, missing field, rule violation) |
| Used by | Most servers for any client error | Laravel, Rails, FastAPI for validation |
| Response body | Often a generic message | Usually field-by-field errors |
Rule of thumb
Can the server read your request at all? If not, 400. If it can but doesn’t like the values, 422.