HTTP 400 Bad Request
HTTP 400 Bad Request means the server cannot process the request because of a client error, such as malformed syntax, invalid JSON, a missing required…
Quick answer
HTTP 400 Bad Request means the server cannot process the request because of a client error, such as malformed syntax, invalid JSON, a missing required parameter, oversized cookies or a bad header. The client should fix the request before trying again.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 400 Bad Request mean?
400 is the generic client-error code. More specific codes exist and are better when they apply: 401 for missing credentials, 413 for oversized bodies, 415 for the wrong Content-Type, 422 for valid JSON that fails validation, 431 for oversized headers.
| Status code | 400 |
|---|---|
| Name | Bad Request |
| Class | 4xx Client Error |
| Defined in | RFC 9110 §15.5.1 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | No: change the request first |
What causes HTTP 400?
- Invalid JSON or form encoding.
- Missing or malformed required parameters.
- Corrupted or oversized cookies (a frequent cause in browsers).
- Invalid characters in the URL or a header.
How do I fix HTTP 400?
- Return a body that explains which field or header is wrong.
- If browsers get 400 on one site only, clear that site’s cookies.
- Validate input on the client before sending.
What should a client do after HTTP 400?
Do not retry unchanged. Read the error body, fix the request and resend.
Does HTTP 400 affect SEO?
Pages returning 400 are not indexed. If Googlebot hits 400s, check for malformed internal links or URL parameters.
Example 400 response
HTTP/1.1 400 Bad Request
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":400,"message":"Bad Request"}} How to return 400 Bad Request in code
Express (Node.js)
res.status(400).json({ error: 'Bad Request' }); Next.js route handler
return Response.json({ error: 'Bad Request' }, { status: 400 }); FastAPI (Python)
raise HTTPException(status_code=400, detail="Bad Request") PHP
http_response_code(400); Nginx
location = /example {
return 400;
} Other 4xx status codes
The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request
Frequently asked questions
400 vs 422?
Why do I get 400 Bad Request on just one website?
Is 400 a client or server error?
Related
- 422 Unprocessable Content HTTP 422 Unprocessable Content (formerly Unprocessable Entity) means the server understood the request and its.
- 401 Unauthorized HTTP 401 Unauthorized means the request lacks valid authentication credentials: no token, an expired token or .
- 413 Content Too Large HTTP 413 Content Too Large (formerly Payload Too Large or Request Entity Too Large) means the request body is .
- 431 Request Header Fields Too Large HTTP 431 Request Header Fields Too Large means the server rejects the request because its headers are too big,.
- Open the HTTP Status Codes Reference → Free, no signup.