HTTP 400 Bad Request
Status code 400 · Class 4xx
Bad Request
Also searched as: error 400, HTTP 400, 400 bad request, request header or cookie too large
What it means
The server refused to process the request because it considers it malformed or invalid. Visitors typically see '400 Bad Request' when cookies are corrupted or too large, a URL is mangled, or an upload is broken. For API users it means the body, query or headers do not match what the endpoint expects.
Applies to: All browsers, REST APIs, nginx, Apache, IIS
How to fix HTTP 400 Bad Request
- Check the URL for typos, stray characters or broken percent-encoding
- Clear cookies and cache for the site; '400 Request Header Or Cookie Too Large' in nginx is a cookie problem
- Try a private window and disable extensions that modify requests
- If uploading, make sure the file is not too big and the upload finishes
- API clients: compare your request with the docs using 'curl -v' and validate the JSON body and Content-Type header
- If you own the site: check the server error log for the exact rejection reason and the request that caused it
- If you own the site: if large cookies are the cause, reduce cookie size or raise header buffers (nginx 'large_client_header_buffers')
Why it happens
Per RFC 9110, 400 means the server will not process the request due to a client error, such as malformed syntax, invalid framing or deceptive routing. Oversized or corrupt cookies, bad JSON and invalid characters in URLs are the usual triggers.
FAQ
Is a 400 error my fault?
It is caused by the request your browser or app sent, but often by something you did not choose, such as an old cookie. Clearing cookies for the site fixes most visitor cases.
What is the difference between 400 and 422?
400 means the request could not be understood or framed correctly. 422 means it was understood but the data failed validation.
Related errors
Source: IANA HTTP Status Code Registry · fixes written and reviewed by the editors (see our editorial policy)
Last updated: