Short answer: 400 Bad Request is an HTTP error code meaning the server didn’t process your request because it found it malformed or invalid. Most of the time the problem is on the browser side: corrupted or oversized cookies, a mistyped address or a browser extension. The quickest fix is to delete the cookies for that site only and open the page again.
What Does 400 Bad Request Mean?
The HTTP standard (RFC 9110) defines 400 as the server being unable or unwilling to process a request because of something it perceives as a client error, such as malformed request syntax or invalid request framing. Codes starting with 4xx point to the client side, and codes starting with 5xx to the server side. So with a 400 error the server is up, but it won’t accept the incoming request.
Most Common Causes
| Cause | How to tell | Fix |
|---|---|---|
| Corrupted or oversized cookies | Only one site, only your browser; the message may say “Request Header Or Cookie Too Large” | Delete that site’s cookies |
| Malformed URL | The address contains spaces, a lone % sign or broken characters | Correct the address or navigate again from the home page |
| Browser extension | The site opens in a private window (extensions off) | Turn extensions off one by one to find the culprit |
| Stale cache | It started after the site was updated | Clear the cache |
| Server or application side | It happens for everyone, in every browser | The site owner should check the logs |
Step-by-Step Fix for Visitors
- Check the address: Look for typos, spaces or extra characters in the URL. If you copied a long link, it may have been copied incompletely.
- Delete cookies for that site only: In Chrome, click the icon to the left of the address bar and use Site settings > Delete data. This way you stay logged in on other sites.
- Try a private window: If the site opens in a private window, the problem is cookies or extensions.
- Clear the cache: In Chrome, press
Ctrl + Shift + Deleteand clear “Cached images and files”. - Turn off extensions: Temporarily disable ad blockers, VPN and privacy extensions in particular.
- Try another browser or device: If the error happens everywhere, the problem is most likely the site; let the site owner know.
Getting the error while uploading a file? Very large files usually return 413 Content Too Large rather than 400, while very large request headers can result in 431 or a 400 on Nginx. Make the file smaller and try again.
For Site Owners: Server-Side Checks
If every visitor sees the error, check the server logs:
# See which requests got a 400 (Nginx access log)
sudo awk '$9 == 400' /var/log/nginx/access.log | tail -n 20
# Error log
sudo tail -n 50 /var/log/nginx/error.log- “Request Header Or Cookie Too Large”: Caused by the site writing too many or too large cookies. The lasting fix is to reduce unnecessary cookies; as a stopgap you can raise
large_client_header_buffersin Nginx. - Application validation: An API or form may return 400 when missing or invalid fields are sent; check the application’s error message and log.
- Firewall / WAF: A rule may be blocking legitimate requests by mistake; check the WAF logs.
- Proxy or CDN: If there is a CDN in front, use the response headers to tell whether the error comes from the CDN or the origin server.
# Inside the Nginx http or server block (example value)
large_client_header_buffers 4 16k;
sudo nginx -t && sudo systemctl reload nginxCodes Often Confused with 400
| Code | Meaning |
|---|---|
| 401 Unauthorized | You need to log in (authentication required) |
| 403 Forbidden | The request was understood but access isn’t allowed |
| 404 Not Found | The requested page or file wasn’t found |
| 413 Content Too Large | The data sent (for example an uploaded file) is too large |
| 429 Too Many Requests | Too many requests were sent in a short time |
| 431 Request Header Fields Too Large | The request headers are too large |
We cover server-side 5xx errors in our 502 Bad Gateway and 504 Gateway Timeout guide. If you want to manage server settings yourself, take a look at our VDS server options.
Conclusion
A 400 Bad Request error is usually caused by corrupted cookies in the browser or a malformed address, and deleting that site’s cookies fixes it. If everyone sees the error, the problem is on the server; check the logs, cookie size, application validation and firewall rules.
Categories
-
CentOS 7 guides
-
cPanel 20 guides
-
CyberPanel 18 guides
-
Operating Systems 81 guides
-
Juniper Networks 18 guides
-
Control Panels 50 guides
-
Linux 17 guides
-
MySQL 29 guides
-
Network 95 guides
-
Plesk Panel 12 guides
-
Virtual Servers 273 guides
-
SEO 3 guides
-
Cyber Security 8 guides
-
Technology 162 guides
-
VMware 36 guides
-
WordPress 20 guides
-
Artificial Intelligence 22 guides