HTTP 400 Bad Request

Status code 400 · Class 4xx

HTTP

Bad Request

Also searched as: error 400, HTTP 400, 400 bad request, request header or cookie too large

HTTP request chain from browser through CDN and proxy to the origin server
HTTP errors: find which hop in the request chain failed and read its logs.

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

  1. Check the URL for typos, stray characters or broken percent-encoding
  2. Clear cookies and cache for the site; '400 Request Header Or Cookie Too Large' in nginx is a cookie problem
  3. Try a private window and disable extensions that modify requests
  4. If uploading, make sure the file is not too big and the upload finishes
  5. API clients: compare your request with the docs using 'curl -v' and validate the JSON body and Content-Type header
  6. If you own the site: check the server error log for the exact rejection reason and the request that caused it
  7. 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: