Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 400 Bad Request
4xx Client Error

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 code400
NameBad Request
Class4xx Client Error
Defined inRFC 9110 §15.5.1
Cacheable by defaultNo, 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?

  1. Return a body that explains which field or header is wrong.
  2. If browsers get 400 on one site only, clear that site’s cookies.
  3. 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.

Frequently asked questions

400 vs 422?
400 means the request could not be parsed or is structurally wrong. 422 means it parsed fine but the values break a rule, such as an email that is already registered.
Why do I get 400 Bad Request on just one website?
Usually corrupted or too-large cookies for that site. Clearing that site’s cookies typically fixes it.
Is 400 a client or server error?
400 is in the 4xx class, so it is classed as a client error: the request needs to change before it can succeed.