Runs in your browser. Your files and text never leave your device - nothing is uploaded.
4xx Client Error
What it means
The request is well-formed but contains semantic errors the server can't process.
| Property | Detail |
|---|---|
| Status class | 4xx Client Error |
| Defined in | RFC 9110, Section 15.5.21 — RFC 9110 calls it 422 Unprocessable Content. It was first defined for WebDAV as 422 Unprocessable Entity in RFC 4918, and RFC 9110 adopted it for all of HTTP in 2022. |
| Cacheable by default | Only with explicit caching headers: a cache stores it when the response carries Cache-Control (max-age, s-maxage or public) or Expires. |
| Who needs to act | The client, which has to correct the flagged fields. |
What does HTTP 422 Unprocessable Entity mean?
HTTP 422 means the server understood the request's format and could parse it, but could not process the instructions it contained, typically because a value failed validation. An email field without an @ in otherwise valid JSON is the classic case. RFC 9110 names it Unprocessable Content; its original WebDAV name is Unprocessable Entity.
How 422 Unprocessable Entity works
The definition rules out two neighbours. The content type is understood, so 415 does not fit, and the syntax is correct, so 400 does not fit either. What is left is semantic: the instructions in the body cannot be carried out. Modern frameworks rely on the code heavily. Laravel returns 422 with a list of errors per field when validation fails, FastAPI returns 422 when a request does not match its declared types, and Rails answers 422 when a form arrives with an invalid CSRF authenticity token. In every case the response body is where the useful information is.
Example 422 request and response
POST /api/signup HTTP/1.1
Host: example.com
Content-Type: application/json
{"email": "ana.example.com", "password": "123"}
HTTP/1.1 422 Unprocessable Content
Content-Type: application/json
{"errors": {"email": ["must be a valid email"], "password": ["is too short"]}}The JSON parses correctly, but two fields fail validation, and the body names each one.
What causes a 422 Unprocessable Entity
- A field that fails a rule: an invalid email, a password that is too short, a date in the past.
- A request body that does not match the API's schema or data types.
- Business rules broken by otherwise valid data, such as ordering more items than are in stock.
- In Rails applications, an expired or missing CSRF authenticity token on a form submission.
How to fix a 422 Unprocessable Entity
If you sent the request
- Read the error list in the body and fix each flagged field.
- Check data types as well as values; a number sent as a string can fail schema validation.
- For a Rails form, reload the page to get a fresh CSRF token and make sure cookies are enabled.
If you build the API
- Return field-level errors in a consistent format, such as RFC 9457 problem details.
- Use 400 for syntax errors and 422 for validation errors, and document the split.
Related status codes
- 400 Bad Request: The request could not be parsed at all, for example invalid JSON.
- 415 Unsupported Media Type: The body format itself is not accepted.
- 409 Conflict: Valid data that clashes with the current state, such as a duplicate.
Tools that help
- JSON Formatter confirms the body is valid JSON, so the problem is the values.
- Email Validator checks an address before you submit it.
Frequently asked questions
The request is well-formed but contains semantic errors the server can't process.
Common in REST APIs for validation failures - correct JSON syntax, but a field fails business-logic validation (e.g. an invalid email format).
Check the response body for validation error details and correct the specific field(s) flagged.
Both are common. RFC 9110 defines 422 for content that is syntactically correct but cannot be processed, which fits validation failures precisely, while 400 is the broader catch-all. Many APIs use 400 for malformed requests and 422 for invalid values.
Sources
Other 4xx Client Error codes
Reviewed by Raja Jahangir · Last reviewed: October 7, 2026
