As you browse the web, you may come across invalid pages. In some cases, the site’s server may not understand the request for that content. I get a “400 Bad Request” error message instead of the requested resource.
Luckily, the 400 Bad Request problem is easy to fix. Fixing a typo in the URL often does the trick, but you may also need to clear your browser’s cache or temporarily disable extensions.
This post explains what the 400 Bad Request error is and what causes it. Next, we’ll look at six different ways to fix it. let’s start!
Overview of 400 Bad Request errors
When you try to access a web page, your browser requests site data from the server. The web server then processes the request. Within the HTTP header is a status code that describes whether the request was successful.
A successful HTTP request does not display a status code. However, you may see an error message similar to “” in your web browser.400 Bad Request“:
This 400 level HTTP status code indicates that there was a client-side error in the request. As a result, the requested page cannot be displayed.
This error usually appears as “400 Bad Request”, but it may show some variations.
- Bad Request – Invalid URL
- HTTP error 400
- HTTP Error 400 – Bad Request
- HTTP Status 400 – Bad Request
- 400 Bad Request. The server could not understand the request due to incorrect syntax. Clients should not repeat requests without modification.
- bad request. Your browser sent a request that this server does not understand.
- 400 Bad Request.Request header or cookie too large
- Bad Request – Error 400
The 400 Bad Request error can be very frustrating as it blocks access to your site without providing any useful information. Let’s discuss some of the most common causes.
Potential causes of 400 Bad Request errors
If the server returns 400 Bad Request it means it cannot understand and process the request. This is usually caused by a client-side error. This means that there is a problem on your side.
Here are some common issues that cause 400 Bad Request errors:
- Invalid URL syntax: You may have typed the URL incorrectly or used invalid characters.
- Corrupted browser cache or cookies: If your browser’s cookies have expired or your cache is corrupted, the server may not be able to properly serve your request.
- Competing browser extensions: In some cases, browser extensions can interfere with requests and cause a 400 Bad Request.
- bad DNS cache: Locally cached DNS data may be out of sync with the domain’s current DNS registration.
- Uploaded file size is largeNote: Uploading large files to the site may exceed the upload limit.
Alternatively, you may see a 400 HTTP error due to a server-side error. For example, the website’s server may be misconfigured or experiencing a temporary glitch.
How to Fix the 400 Bad Request Error (6 Ways)
If you see a 400 Bad Request error, try refreshing the page. In some cases, this resolves temporary glitches. If that doesn’t work, try the next step.
1. Check if the address is correct
First, check the URL for errors. This is one of the most common causes of 400 Bad Request.
The address may contain typos, incorrect syntax, or extra characters. It’s important to go back to the domain name, directory path, and query string to make sure the address is correct.
Special symbols are checked during this process. For example, random characters such as hyphens (-) and percentages (%) can cause Bad Requests.
Some URLs contain special characters and you should make sure they are coded correctly. You can check the address using URL decoder/encoderThis tool identifies invalid characters in URLs.
Then try searching the URL again. If you see the same 400 error, try searching for the webpage in a different way.
For example, you can perform a search for your site’s domain name and related keywords. If you’re looking for articles about featured image sizes, type “site: dreamhost.com featured image sizes” into your search engine.
This makes the page accessible without manually entering the URL. However, you may still get a 400 Bad Request error. If this happens, proceed to the next method.
2. Clear your browser’s cache and cookies
Browsers store site data in cache. This allows the browser to serve the cached content when you visit the site again in the future, making the page load faster.
As you browse the Internet, cookies are also stored in your browser. These are small files that contain data such as the length of your browsing session. Cookies can also remember personal information such as login details and site preferences.
Browser cache and cookies are useful tools, but they can also get corrupted. Additionally, cookies can eventually expire. When this happens, it can trigger a 400 Bad Request.
To resolve this issue, clear cache and browser cookies. In Google Chrome you have to click on his 3 dots icon in the top right corner.Then select More tools > Clear browsing data:
This will open a pop-up window where you can select the data to erase.Please select Cookies and Other Site Data the same as Cached images and files:
The process is slightly different if you get a Bad Request error on a different device or browser type.When using iphone Also microsoft computercertain caches, cookies, or Browse data.
Be aware that this will sign you out of many websites. Revisiting these sites may also result in slow loading times. However, it may remove corrupted or outdated data that causes a 400 Bad Request.
3. Disable Browser Extensions
If you are a website owner, you know that third party plugins can cause many WordPress errors. Similarly, browser extension software can interfere with requests.
First, try disabling extensions. If you’re using Google Chrome, click the three dots again to go to: More Tools > Extensions:
This will bring up a page where you can manage your Chrome extensions. Use the toggle switch to turn everything off.
Now reload the page that triggered the Bad Request. If it loads successfully, one of these extensions is causing the error.
To find the problematic extension, reactivate them one by one, each time you check to see if an error is returned. When it happens, remove the extension that caused it. This will prevent future 400 HTTP status codes.
4. Flush your DNS cache
When you visit a website for the first time, some of its data is stored in your local cache. To make pages load faster, your computer stores DNS information about her website. This eliminates the need to look up your site’s nameservers and IP address each time you return to your site.
Like browser caches, DNS caches can become corrupted or outdated. Websites sometimes update their DNS information. If this conflicts with cached data, you may get a 400 Bad Request error.
To fix this error you need to: flush DNS cacheFor macOS operating systems running on Monterey and Big Sur, open a terminal and enter the following command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
If you’re using Windows 10, open a command prompt and enter the following command:
ipconfig /flushdns
Linux operating systems use Terminal as the command line. To flush DNS, just run the following command:
sudo systemd-resolve --flush-caches
You may also need to flush your browser’s DNS cache. To do this in Google Chrome, paste the following line into the search bar.
chrome://net-internals/#dns
Then click clear host cacheThis will flush your browser’s DNS cache.
After successfully flushing the DNS, check if this fixed the error. If not, you’ll have to try another method.
5. Check the uploaded file size
A 400 Bad Request error may appear immediately after uploading a file to a website. In this case, the file may be too large to upload to the site’s server.
All sites have a maximum file upload size. This is set by your hosting provider, but is usually between 2 and 500 MB. Uploading a larger file may result in a Bad Request.
To see if this is the case, start by uploading a small file. If this succeeds, you should resize or compress the original file.
You can use tools like Tiny PNG To reduce file size:
You can also upload a zip file if your site allows it. Ultimately, the file size should be small enough to fit within the server’s file size upload limit.
6. Troubleshoot your device and internet connection
If every page you visit returns a 400 Bad Request, you probably have a poor internet connection. Try switching to a different network to see if this is the case. For example, you can turn off his Wi-Fi on your mobile device and use your cellular data.
If this resolves the error, you can troubleshoot your internet connection. You may need to reboot your Wi-Fi router. Alternatively, consider contacting your service provider to resolve the issue.
You can also turn off the device and turn it on again. This may help resolve Bad Requests by clearing random access memory (RAM), flushing temporary caches, and closing running programs.
Error-free browsing
The 400 Bad Request error is a client-side HTTP status code that occurs when the server is unable to fulfill the request. This is usually caused by a mistyped URL, a corrupted browser cookie, or a conflicting browser extension.
Luckily, there are many ways to fix the problem. One simple solution is to reload your browser and check for any temporary glitches. However, you may need to flush your DNS cache, reboot your device, or reduce the size of the file you upload.
Subscribe to the DreamHost blog for error troubleshooting tips. We update it every time we post new content.
Deliver content directly to your inbox
Subscribe to our blog to get great content like this delivered straight to your inbox.