The 400 Bad Request error occurs when the server cannot understand or process your request because it’s malformed, incomplete, or incorrect. Unlike server-side errors (like 500), this one typically comes from the client side — your browser, device, or request.
When you visit a website, your browser sends a request to the server. If the request is badly formatted or contains invalid information, the server rejects it and returns:
400 – Bad Request
“I don’t understand what you’re asking me to do.”
This is a client-side error, meaning something went wrong before the server could even process the request.
Cause | Description |
---|---|
Malformed URL | Typos, invalid characters, or incorrect structure in the web address |
Corrupted cookies | Outdated or conflicting cookies stored in your browser |
Too large request headers | Overloaded request (e.g., too many or too large cookies) |
DNS cache issues | Outdated IP address or DNS data stored on your system |
Faulty browser extensions | Add-ons that modify or break request data |
Broken API/form requests | Missing fields, wrong content type, or invalid JSON in POST/GET requests |
Follow these steps in order — most 400 errors are easy to fix:
Example of a broken URL:
https://example.com//page?id==abc@@
Corrupted cookies are the #1 cause of 400 errors.
Your device may have cached outdated or incorrect DNS info.
ipconfig /flushdns
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Open the same URL in Firefox, Safari, or on a different phone or computer. If it works, the problem is in your primary browser.
These can alter your requests or block certain content. Disable all extensions and try again.
If you’re working with APIs or web forms:
Validate all input fields
Use correct headers (e.g., Content-Type: application/json)
Ensure proper data format (JSON, URL-encoded, etc.)
Scenario | Solution |
---|---|
Form returns 400 | Check required fields and method (POST/GET) |
Error after site migration | Clear DNS and browser cookies |
Admin panel not loading | Disable plugins and clear session cookies |
API request fails | Validate JSON and headers |
The 400 Bad Request error means your browser sent a request the server couldn’t process — typically due to bad formatting, cookies, or DNS issues.
To fix it: