Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Troubleshooting

400 Bad Request: what it means and how to fix it

A 400 Bad Request means the server refuses to process the request because it considers it malformed: bad syntax, invalid message framing or deceptive routing. Resending the identical request fails again, so change something: the URL, the cookies, or the request body.

The short answer
  • The server judged the request itself invalid, not the server state.
  • Visitors: retype the URL, clear cookies for the site, retry in a private window.
  • Developers: validate JSON, headers and Content-Length against what you actually send.
Try the website status checkerFree, live, no signup

What causes a 400 Bad Request?

MDN names three causes: malformed syntax, invalid message framing, and deceptive request routing.

Malformed syntax

Invalid JSON, an unescaped character in the URL, or a body that does not match its declared content type.

Invalid framing

A Content-Length that does not match the body, or a broken chunked encoding.

Deceptive routing

A request whose Host or target conflicts, which servers reject as unsafe.

Bad URL

Illegal characters, a broken percent-encoding, or a URL cut off when pasted.

Oversized headers or cookies

Some servers reject requests whose headers or cookies exceed their limits. Limits vary by server.

Failed validation

Many APIs return 400 for a missing field or wrong type, with the reason in the body.

How do you fix a 400 as a visitor?

  1. 01

    Check the address

    Retype the URL and remove odd characters, spaces or a trailing fragment pasted from elsewhere.

  2. 02

    Clear cookies for that site

    A corrupt or oversized cookie can make every request to one site fail. Clear that site only.

  3. 03

    Try a private window

    If it loads there, an extension or a stored cookie is the cause.

  4. 04

    Retry a smaller upload

    If it happens on a file upload, test with a smaller file or a different format.

  5. 05

    Contact the site

    If nothing helps, send the owner the URL, the time and what you did before the error.

How do you reproduce a 400 from the command line?

curl: see the exact request and the response body
# verbose: shows the request headers sent and the response
curl -v -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"email":"b@example.com","username":"b.smith"}'

# the response body usually names the invalid field

MDN notes that repeating the same request without changes fails again. Compare the failing request with a working one and change one thing at a time.

Is it 400, 401, 403 or 404?

Client errors people confuse
CodeProblemFix on your side
400The request itself is malformedCorrect the request
401No valid authenticationLog in or send a token
403Refused despite known identityAsk for access
404Nothing at that URLFix or redirect the URL

What should a developer check on a 400 response?

  • The response body, which often names the field or rule that failed
  • The JSON is valid and strings are escaped, with no trailing commas
  • The Content-Type header matches the body format you send
  • Content-Length, if set by hand, matches the real body size
  • URLs are percent-encoded and not truncated by a copy or a template bug
  • Header and cookie sizes stay under the limits of your server and proxies

Common questions

What does 400 Bad Request mean?

It means the server will not process the request because it appears malformed, for example invalid syntax, wrong message framing or misleading routing. The server blames the client request, and repeating it unchanged gives the same error.

How do I fix a 400 Bad Request in Chrome?

Check the URL for typos, clear cookies for that site, then retry in an Incognito window. If it works there, disable extensions one by one. If it fails everywhere, the site or request is at fault, so contact the owner.

Is a 400 error the server fault?

Usually the request is at fault, but servers can be strict or misconfigured, for example rejecting valid long headers. If a request that worked before now fails with 400, compare what changed on both sides.

How do I fix a 400 error in an API?

Read the response body, which usually names the invalid field. Validate the JSON, confirm the Content-Type header matches the body, and check required fields and types against the API documentation. Test with curl -v to see exactly what is sent.

Does a 400 error hurt SEO?

Google treats 4xx responses other than 429 as content that does not exist and drops indexed URLs that return them. A 400 on a normal page URL is rare, so look for malformed links, bad redirects or a server rule rejecting valid requests from crawlers.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.