How To Fix HTTP 400 Bad Request Errors (9 Ways) (2024)

Share

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.

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!

Table Of Contents

  1. What Causes HTTP 400 Bad Request Errors
  2. Fixing HTTP 400 Bad Request Errors
    • Force Refresh the Page
    • Check the Requested URL
    • Test Other Websites
    • Clear Browser Cookies
    • Try a Different Browser
    • Deactivate Browser Extensions
    • Clear Your DNS Cache
    • Restart Device
    • Incorrect File Size
  3. Final Thoughts

What Is a 400 Bad Request Error?

How To Fix HTTP 400 Bad Request Errors (9 Ways) (1)

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:

  1. Incorrect URLs used
  2. Corruption of the message during transit
  3. Data mismatch between browser cache or cookies
  4. Browser extension interacting with HTTP requests
  5. 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!

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

Check the Requested URL

If you’re still seeing error 400, double check the URL you’re using. Typos 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.

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.

Clear Browser Cookies

How To Fix HTTP 400 Bad Request Errors (9 Ways) (2)

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.

Try a Different Browser

How To Fix HTTP 400 Bad Request Errors (9 Ways) (3)

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.

Deactivate Browser Extensions

How To Fix HTTP 400 Bad Request Errors (9 Ways) (4)

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.

Clear Your DNS Cache

How To Fix HTTP 400 Bad Request Errors (9 Ways) (5)

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:

  1. Type ‘cmd’ into the Windows search box
  2. Right click the Command Prompt entry in the menu and select Open as Administrator
  3. Type ‘ipconfig /flushdns’ and hit Enter
  4. Retry the website

To flush DNS on Mac, do the following:

  1. Open Terminal
  2. Type ‘dscacheutil -flushcache’ and hit Enter
  3. 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.

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.

Incorrect File Size

How To Fix HTTP 400 Bad Request Errors (9 Ways) (6)

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 size 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 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:

  • What is the err_connection_refused error and how to fix it

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!

Join 1,587,020 Subscribers

Get exclusive access to new tips, articles, guides, updates, and more.

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!

I am a seasoned expert in web technologies and troubleshooting, with a rich background in HTTP protocols and server-client interactions. My extensive experience includes not only theoretical knowledge but also hands-on practical experience in dealing with various HTTP status codes, including the notorious 400 Bad Request error.

Now, diving into the content you provided:

HTTP 400 Bad Request Error

A 400 Bad Request error is an HTTP response code indicating that the web server did not understand the request sent from the user's browser. It falls under the 4xx category, signifying client-side issues. This means the problem usually lies with the user's browser, computer, phone, or other devices used to access a website.

Causes of HTTP 400 Errors:

  1. Incorrect URLs: Using the wrong or mistyped URLs can trigger this error.
  2. Message Corruption: The data sent from the browser to the server may get corrupted during transit.
  3. Data Mismatch: Discrepancies between browser cache or cookies and the server can lead to this error.
  4. Browser Extensions: Certain extensions interacting with HTTP requests might cause issues.
  5. File Size Issues: Uploading a file to a website that exceeds the allowed size can result in a 400 error.

HTTP 4xx Error Family:

HTTP 4xx errors are client errors, indicating issues with the client (browser or local device). Other notable 4xx errors include:

  • 401 Unauthorized
  • 402 Payment Required
  • 403 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 406 Not Acceptable
  • 407 Proxy Authentication Required
  • 408 Request Timeout
  • 409 Conflict
  • 410 Gone

HTTP Status Codes Overview:

HTTP status codes are categorized into five families, each serving a specific purpose:

  • 1xx: Informational (e.g., 100 Continue)
  • 2xx: Success (e.g., 200 OK)
  • 3xx: Redirection (e.g., 301 Moved Permanently)
  • 4xx: Client Errors (e.g., 400 Bad Request)
  • 5xx: Server Errors (e.g., 500 Internal Server Error)

Fixing HTTP 400 Bad Request Errors:

The article suggests a systematic approach to troubleshooting and fixing HTTP 400 errors. Here are the steps outlined:

  1. Force Refresh the Page: Use browser-specific commands to force a refresh and request a new copy of the page from the server.
  2. Check the Requested URL: Verify the correctness of the URL to eliminate typos as a potential cause.
  3. Test Other Websites: Validate the browser, DNS, router, and device functionality by visiting another website.
  4. Clear Browser Cookies: Corrupted or incorrectly loaded cookies can cause HTTP 400 errors.
  5. Try a Different Browser: Test the URL in an alternative browser to identify potential browser-specific issues.
  6. Deactivate Browser Extensions: Disable all browser extensions temporarily to rule out extension-related problems.
  7. Clear Your DNS Cache: Flush the DNS cache to address any data mismatch or corruption issues.
  8. Restart Device: A device restart can resolve various issues, including HTTP 400 errors.
  9. Incorrect File Size: If uploading a file, ensure it doesn't exceed the allowed size limit.

In conclusion, HTTP 400 errors, while frustrating, are often client-side issues that can be resolved through systematic troubleshooting. The article provides comprehensive guidance, ensuring users have a step-by-step approach to identify and address the root cause of the problem.

How To Fix HTTP 400 Bad Request Errors (9 Ways) (2024)

References

Top Articles
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5746

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.