The 400 bad request is an HTTP response code sent from a web server that didn’t understand the request sent from your browser.
It isn’t the most descriptive of error codes but the fact it’s an HTTP 4xx code means it’s client side error.
That means it’s typically an issue with your browser, computer, phone or whatever device you’re using to access the website.
Don’t worry though, HTTP error 400 is not serious and is more frustrating than service affecting. There are lots of ways to fix it too.
We’re going to walk you through what a 400 bad request error is, what causes it and how to fix it.
We’ll walk you through every step and show you exactly what to do and how to do it.
By the end of this post, you’ll know everything you need to know about this particular error and how to fix it!
What Is a 400 Bad Request Error?
A 400 bad request error is an HTTP error that occurs when the request sent from your browser is not understood by the web server.
It’s one of a series of HTTP 4xx errors that are known as client errors because they are usually caused by the client (the browser or local device) rather than the hosting server.
There are times when the 400 bad request error isn’t a client error though. That’s typically when you’re uploading a file to a website.
If that’s what you’re doing when the error occurs, we cover how to fix that at the end of the article.
The HTTP 4xx error family includes:
- 400 Bad Request – The server didn’t understand the request
- 401 Unauthorized – Required authentication was not provided
- 402 Payment Required – Not currently in use
- 403 Forbidden – The browser does not have permission to make that request
- 404 Not Found – The page you’re looking for does not exist or cannot be found
- 405 Method Not Allowed – The type of request is not authorized or not supported
- 406 Not Acceptable – The server cannot provide the data in the requested format
- 407 Proxy Authentication Required – Request must first be authenticated by a proxy
- 408 Request Timeout – The server did not receive the request in a timely manner
- 409 Conflict – The server resources being requested have different versions or multiple copies
- 410 Gone – The page being requested does not exist and has been manually removed
There are 28 HTTP 4xx codes in all but these are the ones you’ll see most often.
HTTP Status Codes
There are hundreds of HTTP status codes covering almost every eventuality.
They are given numbers to help you quickly identify the potential issue you’re facing and are split into five distinct families.
- HTTP 1xx – For information only. Initial response to say everything is proceeding as normal.
- HTTP 2xx – For information only. Confirmation that an HTTP request has been received and accepted.
- HTTP 3xx – Redirection codes. The browser needs to take extra action such as redirect to another URL to complete the request.
- HTTP 4xx – Client error codes. Something is wrong with the request from the browser to the web server.
- HTTP 5xx – Server or network error codes. The server encountered an issue or error preventing it fulfilling the request.
This page at Moz has a fuller explanation of HTTP status codes and what they all mean.
What Causes HTTP 400 Bad Request Errors
We hinted at the most common causes of HTTP error 400 above. It’s mainly a client error, meaning your browser or device.
There are situations where it could be the network or web server corrupting the message before it arrives but client errors make up the vast majority of HTTP 400s.
HTTP error 400 can be caused by:
- Incorrect URLs used
- Corruption of the message during transit
- Data mismatch between browser cache or cookies
- Browser extension interacting with HTTP requests
- Uploading a file to a website that’s too large
That last is rare but we have personal experience of it when uploading files to WordPress. We’ll cover how to fix it in this guide.
Fixing HTTP 400 Bad Request Errors
Fixing 400 bad request errors is usually a case of troubleshooting your browser or device.
As the error message is pretty vague, it’s usually a case of trial and error when troubleshooting. The following are the steps we would usually take to address the error when it occurs to us.
- Force Refresh the Page
- Check the Requested URL
- Test Other Website
- Clear Browser Cookies
- Try a Different Browser
- Deactivate Browser Extensions
- Clear Your DNS Cache
- Restart Device
- Incorrect File Size
It begins with the quick and easy fixes before moving into more involved tasks. We walk you through every step of the way though, so you’re in good hands!
1. Force Refresh the Page
Refreshing the web page is typically the very first thing we do whenever there’s an issue loading a website.
A forced refresh tells the browser to ignore any cached copies of the page it might have and to request a new copy from the server.
It’s quick, easy and can often fix many of the more common issues.
Use one of these key combinations to force a refresh of your browser.
- Chrome on Windows: Ctrl + F5
- Chrome on Mac: Command + Shift + R
- Firefox on Windows: Ctrl + F5
- Firefox on Mac: Command + Shift + R
- Safari: Command + Option + R
- Microsoft Edge: Ctrl + F5
2. Check the Requested URL
If you’re still seeing error 400, double check the URL you’re using. Typos or special characters in the URL are another common cause of the error. Given how many URLs we use per day, it’s very easy mistake to make.
If you typed the URL, take a good look at it to make sure you didn’t make a mistake.
Do the same if you used a favorite, just in case.
3. Test Other Websites
While HTTP 400 does not usually indicate an issue with your device or browser, we can quickly test that by visiting another website.
By testing another site, you’re validating your browser, DNS, router and the device you’re using.
Load the Astra website or another website and see what happens.
If they load correctly, it’s definitely something affecting that particular URL.
If they don’t load correctly, it could be a wider browser or device issue.
4. Clear Browser Cookies
Cookies are small files that remember when you last visited a website and any pertinent data about that visit.
For example, if you put something in a shopping cart, it may have been recorded in a cookie so it’s there when you return.
Sometimes, cookies can become corrupted, partially overwritten or loaded incorrectly which can cause HTTP 400 errors.
As clearing browser cookies is simple, let’s try that next.
Use one of the following shortcuts to access the cookie page of your browser:
- Chrome on Windows: Ctrl + Shift + Delete
- Chrome on Mac: Command + Shift + Delete
- Firefox on Windows: Ctrl + Shift + Delete
- Firefox on Mac: Command + Shift + Delete
- Safari: Settings > Safari > Clear History and Website Data
- Microsoft Edge: Command + Shift + Delete
Once on the page, delete cookies and cached data and retest the URL you’re trying to reach.
If the page loads, it was a cookie issue causing the HTTP 400 error.
If the page doesn’t load, try the next fix.
5. Try a Different Browser
If you’re seeing the HTTP error 400, try the URL in a different browser. Unless you have made any changes to the current browser, it shouldn’t make a difference.
We have seen browser issues send invalid HTTP headers to websites before and this is a quick test to see if that’s the cause here.
If the website works in a different browser, troubleshoot the other one. Deactivate browser extensions, reset any preferences and, as a last resort, reinstall the browser.
If the website still doesn’t work, move on to the next fix.
6. Deactivate Browser Extensions
Have you added a new browser extension recently? Have you installed a VPN extension? Ad blocker or proxy extension? Anything that can influence web traffic?
While most browser extensions are well coded and do exactly what they say they do, not all are so well made. As they have been known to cause HTTP 400 errors, let’s disable extensions next.
In Chrome:
Settings > More Tools > Extensions > Toggle off all extensions
In Firefox:
Settings > Add-ons and Themes > Toggle off all extensions
In Microsoft Edge:
Settings > Extensions > Toggle off all extensions
In Safari:
Safari > Preferences > Extensions > Toggle off all extensions
Other browsers will likely be a variant of Chrome or Firefox and should use similar methods.
7. Clear Your DNS Cache
DNS, Domain Name System, is what links URLs to the IP addresses of the server hosting the website. If there is a mismatch between what your computer holds in its DNS cache and the actual web server, it can cause HTTP 400 errors.
Any corruption in the DNS cache can also cause these errors. As flushing the cache is easy, let’s try that next.
To flush DNS in Windows, do the following:
- Type ‘cmd’ into the Windows search box
- Right click the Command Prompt entry in the menu and select Open as Administrator
- Type ‘ipconfig /flushdns’ and hit Enter
- Retry the website
To flush DNS on Mac, do the following:
- Open Terminal
- Type ‘dscacheutil -flushcache’ and hit Enter
- Retry the website
If the website loads correctly, there is likely a corruption, old data or data mismatch in your DNS cache. You should be able to access the website as normal now.
If it isn’t fixed, your final option is to restart the device.
8. Restart Device
Restarting your device can fix all kinds of issues. There’s a good reason every IT or network support tech will always ask you if you have rebooted when you talk to them.
A reboot flushes all memory and all cached data held in memory. When the device loads again, it reloads everything it needs from stored files.
This can be enough to fix a multitude of errors, including the HTTP 400 error.
So, go ahead and restart your device and see what happens.
9. Incorrect File Size
The final fix stands on its own because it’s a different type of issue than these others.
All the fixes so far are concerned with you not being able to access the website. This fix is relevant if you’re trying to upload a file to a website or web server and see the HTTP 400 bad request error.
The HTTP error 400 can be caused by the file you’re uploading being too large. That’s usually because there’s a file upload limit set on the website or server.
This happens if you’re uploading large images, audio or video to a website that exceeds the file size upload limit. If it’s your own website, there may be a file size limit set by your web host.
The test for this is simple. Find a much smaller file and try to upload it to the website in exactly the same way.
If it works, you’re likely hitting the file size limit and are seeing HTTP error 400. Read this post to learn how to increase the maximum file upload size in WordPress.
Final Thoughts
HTTP error 400 is relatively simple despite the lack of detail in the error itself.
HTTP 4xx usually means client side, your browser, your phone, your computer. Usually that’s all you need to know.
The rest is simply a matter of trial and error and the fixes within this post are usually all you’ll need!
Recommended Articles:
Do you know of any other fixes for error 400? Have any experiences of it you’d like to share? Tell us your thoughts below!
Pratik Chaskar holds the pivotal role of CTO at Brainstorm Force, serving as the backbone of the company. Renowned for his organizational skills, strategic thinking, problem-solving attitude, and expertise in leading and executing plans, Pratik plays a crucial role in the BSF’s technological landscape.
Disclosure: This blog may contain affiliate links. If you make a purchase through one of these links, we may receive a small commission. Read disclosure. Rest assured that we only recommend products that we have personally used and believe will add value to our readers. Thanks for your support!
Hello thank you for all the useful information. Not sure if you have any ideas on this but I keep getting a lot of 502 bad gateway error messages on Chrome when visiting multiple sites, it happens all the time on more then one site.
Today I got the 502 bad gateway error message when on Chrome when trying to visit a particular site. I then tried the site on Safari and could get to the site without a problem. It was a site I had visited before: it is a blog and allows for comments. I left a comment and left my info as I always do: name, email, website and this time I got the 400 bad request error.
So I am having issues with two different browsers. This was something that use to happen occasionally now it happens on a daily basis. Not sure if you can help but do you have any idea why this would be happening? Could it be something with my computer itself?
Thank you
Hello Alicia, the issue could be with your server restriction, please do check by checking via a different network and check if there are any blockers with firewall.
I have a “400 Bad Request” window taking up about 1/6th of my screen. It is on both Google and Firefox screens. It does Not appear on my other computer.
I have done all of the “fixes listed on the internet and nothing affects this notice.
Is this some sort of malware?
Do check if the site and pages are accessible! If not the sitemap would require to checked. Do review the Google Console for help in this matter.