HTTP 400 Bad Request

The server can’t or won’t handle the request because something in it is malformed.

Bad Request

4xx Client errorStandardRFC 9110, section 15.5.1

The server can’t or won’t handle the request because something in it is malformed.

Example response
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
Date: Sun, 15 Nov 2026 09:30:00 GMT

{"type":"about:blank","title":"Bad Request","detail":"Body is not valid JSON: unexpected token } at position 41"}

What 400 means

The server can’t or won’t handle the request because of something it sees as a client mistake: broken syntax, a malformed header, invalid framing, or data it can’t parse.

When servers send it

As the general “your request is wrong” code when nothing more specific (401, 404, 413, 422 and so on) fits. Proxies and servers also send it for oversized cookies or bad headers.

Common causes

  • Invalid JSON in the request body (a trailing comma, single quotes).
  • A missing required field or query parameter.
  • Cookies or headers too large for the server (nginx shows “400 Request Header Or Cookie Too Large”).
  • Plain HTTP sent to an HTTPS port (nginx shows “The plain HTTP request was sent to HTTPS port”).
  • A malformed URL, such as a bad percent-escape like %E0%A4%A.

How to fix it as a developer

  • Read the response body: well-built APIs say which field is wrong.
  • Validate JSON before sending it. The JSON formatter marks the exact problem.
  • Check the Content-Type matches the body, such as application/json.
  • When you’re the server, return a clear error body and use 422 for well-formed data that fails validation, if your API style allows it.

How to fix it as a visitor

  • Check the address for typos or odd characters.
  • Clear cookies for the site. Oversized or corrupt cookies are a common cause.
  • Try a private window, which starts with no cookies or extensions.

Related codes

Where it’s defined

400 Bad Request is defined in RFC 9110, section 15.5.1. It’s a 4xx code, the client error class: something is wrong with the request, so sending it again unchanged won’t help.

Other 4xx codes

401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 406 Not Acceptable · 408 Request Timeout · 409 Conflict · 410 Gone · 413 Content Too Large · 414 URI Too Long · 415 Unsupported Media Type · 418 I’m a teapot · 422 Unprocessable Content · 429 Too Many Requests · 431 Request Header Fields Too Large · 451 Unavailable For Legal Reasons · 499 Client Closed Request

Or search them all in the HTTP status code list.

Questions people ask

What does HTTP 400 Bad Request mean?
The server can’t or won’t handle the request because something in it is malformed.
Should I use 400 or 422 for validation errors?
Both are common. 400 is for requests the server can’t parse at all; 422 says “I understood it, but the data is invalid”. Many APIs use 400 for everything. Pick one style and be consistent.
Why do I get “400 Request Header Or Cookie Too Large”?
Your browser is sending more cookie data than the server allows. Clearing the site’s cookies usually fixes it. If you run the site, cut down the cookies you set, or raise nginx’s large_client_header_buffers.
↑↓ move↵ openesc close