HTTP 422 Unprocessable Content: What It Means and When You See It
Quick Answer
HTTP 422 Unprocessable Content means the request was well-formed but contains semantic errors — for example, validation failures on form fields.
HTTP 422 vs 400
HTTP 400 Bad Request means the request is malformed - the syntax is wrong (invalid JSON, missing brackets). HTTP 422 Unprocessable Content means the request is syntactically correct but fails validation - the JSON parsed fine but a field value is invalid (email format wrong, age is negative, required field missing). FastAPI returns 422 automatically for Pydantic validation failures. Django REST Framework returns 400 for both. REST APIs increasingly prefer 422 for validation errors.
Returning 422 in APIs
FastAPI: Pydantic validation failures automatically return 422 with a detailed errors array. Express.js with express-validator: const errors = validationResult(req); if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() }). The response body should identify which fields failed and why: { "errors": [{ "field": "email", "message": "Invalid email format" }] }. Clients should display these errors next to the relevant form fields.
Try the interactive tool
Convert any value instantly — no sign-up required
Frequently Asked Questions
Related Values
100
HTTP 100 Continue means the server has received the request headers and the client should proceed to send the request body. It is an interim response used to inform the client to continue.
101
HTTP 101 Switching Protocols indicates the server is switching to the protocol specified in the Upgrade header field. Commonly used when upgrading to WebSocket connections.
200
HTTP 200 OK is the standard success response. The request has succeeded and the server has returned the requested resource in the response body.
201
HTTP 201 Created means the request succeeded and a new resource was created as a result. The Location header typically points to the new resource URL.