HTTPREF
← Back to status codes

HTTP Status Code

400 Bad Request

Client Error

The server could not understand the request because it was malformed or invalid.

HTTP status code reference, response example, common causes, fixes, and related status codes.

What does HTTP 400 Bad Request mean?

HTTP 400 Bad Request is a status code sent by a server to indicate the result of an HTTP request.

Status codes help browsers, APIs, apps, and backend systems understand whether a request succeeded, failed, was redirected, or needs additional action.

In practice, HTTP 400 Bad Request usually appears when a server responds under specific request, validation, permission, or infrastructure conditions.

Response example

HTTP/1.1 400 Bad Request

HTTP example

HTTP/1.1 400 Bad Request

Common causes

  • Malformed JSON body
  • Missing required request parts
  • Invalid query parameters

How to fix it

  • Check request syntax
  • Validate the request body before sending it
  • Inspect server-side validation rules

Common mistakes

  • Assuming the status code alone explains the full backend issue
  • Ignoring related response headers that add important context
  • Treating temporary errors as permanent failures
  • Retrying too aggressively without checking the cause
  • Debugging the frontend only when the problem is server-side

How browsers and APIs use it

Browsers, APIs, and backend services use HTTP status codes to understand the outcome of a request. Depending on the status code, an application may render content, retry a request, redirect the user, show an error, or trigger a different flow in the client or server.

Developer note

HTTP 400 usually means the request shape is wrong. It is one of the first statuses to check when integrating with an API.

Client-side example

const response = await fetch("/api/items", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify(payload),
});

if (response.status === 400) {
  console.error("Bad request");
}

Related status codes