400 Bad Request error: what it means & how to fix it

Nov 13, 2026 / 10 min Read
400 Bad Request error: what it means & how to fix it

A 400 Bad Request error is an HTTP status code that means the server refused to process your browser’s request because it considered something in it invalid. Common causes include a mistyped or badly encoded URL, corrupted or oversized cookies, a browser extension that changes the request, and an upload that exceeds the site’s limits.

As a visitor, you can usually fix the error in a few minutes:

  1. Check your internet connection and reload the page.
  2. Fix typos and invalid characters in the URL.
  3. Open the page in an incognito window or another browser.
  4. Clear your browser’s cache and cookies.
  5. Deactivate browser extensions.
  6. Flush the DNS cache.
  7. Compress files before uploading them.

Google Chrome users also get a quick Chrome-specific checklist. If the error appears for many visitors or in every browser on your own website, the cause is more likely server-side, so site owners can trace the failing request and check plugins, server size limits, and firewall rules.

What does a 400 Bad Request error mean?

A 400 Bad Request error means the server received your request but couldn’t process it because something was wrong with how it was formatted or what it contained. This is one of the HTTP 4XX status codes that indicates a client-side problem.

What is a 400 Bad Request in simple terms? Think of it like sending a letter with an incomplete address. The post office gets your letter, but can’t deliver it because they can’t figure out where to send it.

Here are the main causes:

CauseDescription
URL syntax errorsTypos, extra spaces, or missing characters like = or & in the web address.
Browser issuesCorrupted cache files, outdated cookies, or conflicting extensions.
Outdated DNS cacheYour computer has old website address information that doesn’t match current records.
Request too largeCookies or request headers exceed the server’s header size limit, or an upload exceeds a limit that the site reports as a 400 error.
Malformed request headersBrowser sends incorrectly formatted information the server can’t read.
Invalid charactersSpecial symbols or encoding that the server doesn’t recognize.

The problem is that most of the time, you will see a generic error message without any context, so it’s hard to know what exactly went wrong.

Here’s what a 400 Bad Request error looks in Google Chrome:

In Safari, the same error message shows up like:

You may also come across different variations of the 400 status code that tell you what the problem might be.

For example, if the cookie data is larger than the allowed size limit, you will see a 400 error code saying Request Header Or Cookie Too Large.

Likewise, entering the wrong web address could trigger the Bad Request – Invalid URL error message.

Is a 400 Bad Request error a client-side or server-side issue?

A 400 Bad Request error is classified as a client error, which means the server received the request and rejected it rather than failing itself. The cause is usually on the visitor’s side, such as a malformed URL, corrupted cookies, or a browser extension that changes the request.

However, the server decides what counts as invalid, so server settings can also trigger a 400 error. Low header size limits, firewall rules, and plugin or application bugs can reject requests that are otherwise normal.

If the error appears in every browser and on every device, or for many visitors at once, the website owner needs to investigate the server side.

Prefer a visual walkthrough? This video covers the most common causes and walks through each fix step by step:

Subscribe For more educational videos! Hostinger Academy

How to fix a 400 Bad Request error

To fix a 400 Bad Request error, you’ll need to work through a few troubleshooting steps that target the most common causes.

Work through the following steps in order. The first checks take seconds and rule out a broken URL or stale browser data before you move on to DNS and upload issues.

1. Check your internet connection

An unstable connection can interrupt a request before the server receives all of it, which is most noticeable when you submit a form or upload a file. Reload the page first, since a one-off interruption often clears on the second attempt.

If the error returns, test your connection with a tool like Google Fiber. If the test shows a much slower speed than usual or the connection drops, switch to another network and try again.

If your connection works fine but the error remains, move on to the next step.

For web browsing, a good ping rate should be between 51 to 150 milliseconds (ms). Anything beyond that means your internet connection is slow. In that case, try using another network and see if the 400 error is solved.

If your connection works just fine, but the error remains, move on to the second step.

2. Fix typos and invalid characters in the URL

Every time you enter a URL in the address bar, check for spelling mistakes and incorrect use of special characters.

For instance, if you type www.hostinger.com/%tutorials in your browser, you will get this message:

Why? The percent sign (%) is reserved for encoded characters, so the server expects two hexadecimal digits after it. Because %tu isn’t a valid code, the server rejects the request as malformed before it looks for the page. The correct URL is www.hostinger.com/tutorials. A correctly formatted URL that points to a page that doesn’t exist returns a 404 Not Found error instead.

URLs use percent-encoding to represent characters that aren’t allowed in a web address. For example, a space becomes %20 and a colon (:) becomes %3A. You’ll often see encoded characters in long URLs with query parameters, like this:

https://login.example.com/authorize?client_id=Paul%20Walker%3ACalifornia
https://login.domaincom/authorize?client_id=Paul%20Walker%3ACalifornia

However, improper encoding can lead to syntax errors. Since the encoded URL is so complicated, it’s easy to miss something, especially if you type it manually.

If you suspect that the URL you’re trying to reach is incorrectly encoded, use an encoder/decoder tool to decode the URL back to its original format.

After that, re-encode the URL following the proper syntax and format.

3. Open the page in an incognito window or another browser

An incognito window loads the page without your existing cookies and, by default, without your extensions, so it quickly shows whether stored browser data causes the 400 error. In Google Chrome, press Ctrl+Shift+N on Windows or Cmd+Shift+N on macOS to open one.

If the page loads in incognito mode or in a different browser, the problem lies in your main browser profile, so clear the site’s cache and cookies or check your extensions next. If the error also appears in incognito mode, the cause is more likely the URL, your network, or the website itself.

4. Clear your browser’s cache and cookies

Cache is temporary storage that keeps copies of web resources (like pages, images, and files) from websites you’ve recently visited. This allows your browser to load these resources faster on return visits instead of downloading them again

And then there are cookies. These are the small text files that websites store on your browser to remember information about your visit. They typically contain things like login session data, shopping cart contents, language preferences, and site settings. This allows websites to recognize you and maintain your preferences between visits.

For instance, you can easily open password-protected pages without having to enter your credentials each time.

However, cache and cookies can become corrupted or outdated, and cookies can grow larger than the server allows. When the browser sends that data with a request, the server may reject it with a 400 error, such as the Request Header Or Cookie Too Large message.

The easiest way to avoid this is to clear browsing data on a regular basis. If you’re a Google Chrome user, follow these steps:

  1. Click the three dots at the top right corner of Google Chrome and select Settings.
  2. Find the Privacy and security section and choose Delete browsing data.
  1. Select Cached images and files and Cookies and other site data.
  2. Set your preferred time range – we recommend all time.
  3. Click Delete data.

The steps are similar in Safari, Mozilla Firefox, and Microsoft Edge.

Keep in mind that deleting cache and cookies means you’ll be logged out of certain websites, depending on your chosen time range.

You may also experience a slower load time, since your browser has to redownload content that was previously stored in the cache.

5. Deactivate browser extensions

Some browser extensions interact directly with cookies, like password managers that store your login credentials, or ad blockers that keep a list of blocked domains and known ad scripts.

When your cookies are compromised, your extensions will send the wrong information to the server. Next thing you know, the server rejects your requests as it can’t find the missing data.

Many browser add-ons may also modify HTTP headers, block JavaScript scripts, and conflict with other extensions, all of which can trigger a 400 error.

Try disabling all your extensions temporarily to see if the error disappears. In Chrome, click the three-dot icon and select Extensions → Manage Extensions. Next, turn off the toggle switch of each extension.

After that, refresh the web page that was displaying the 400 error. If the page loads correctly, this means one of the extensions was causing the problem.

Re-enable the extensions one by one, while refreshing the page after each activation. If the 400 error persists, the most recently enabled extension is likely responsible.

Try updating the suspect extension to see if this resolves the issue. If the extension is up to date, you may need to remove it and find a substitute.

6. Flush the DNS cache

Flushing the DNS cache can fix a 400 error when your computer still uses outdated address information for a website. Browsers rely on the domain name system (DNS) to translate domain names into the IP addresses of the servers that host them.

When you enter a domain name, your browser will look up the DNS servers to find the necessary IP address to load the web page.

By default, these DNS records are stored in your computer’s local cache to speed up loading on repeat visits.

If a website moves to a new IP address, your cached record can send requests to the old server, which may respond with a 400 or another error until the cache updates.

DNS records have built-in expiration times (TTL – Time To Live), so the cache updates automatically. However, when experiencing errors, you may want to clear it manually.

Here’s how to flush the DNS cache on Windows, macOS 11 Big Sur or later, and Google Chrome:

Windows

The following DNS cache flushing method works on Windows 11, 10, 8, and 7:

  1. Type in cmd in the Windows Search and press Enter to access the Windows command prompt console.
  2. Enter ipconfig /flushdns in the command prompt window and press Enter.
  3. A confirmation message should appear, indicating that the DNS resolver cache is successfully flushed.

macOS

Here’s how to flush the DNS cache on macOS 11 Big Sur or later versions:

  1. Use the Spotlight search to find and access the Terminal app.
  1. Once opened, enter the following command and press Enter.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  1. Type in your administrator password when prompted. Note that it will not be visible as you type.

If you’re running macOS Catalina, Mojave, High Sierra, Sierra, El Capitan, Mavericks, Mountain Lion, or Lion, try th

Besides your operating system, you have to remove the outdated DNS cache in your web browser.

For Google Chrome users, simply type chrome://net-internals/#dns in the address bar and press Enter. Then, click Clear host cache to flush the DNS cache within Chrome.

7. Compress your files

Web servers usually set an upload limit to preserve storage space and prevent timeouts. So, if you upload a file that’s larger than the allowed size, the server won’t be able to handle your request.

Many servers answer an oversized upload with a 413 error instead, but some websites and upload forms show a generic 400 Bad Request. If you manage the website and see a 413 message, learn how to fix the 413 Request Entity Too Large error on the server side.

In that case, reduce your file size before trying to upload it again. There are tons of free online tools you can use:

Keep in mind that compressing a file may affect its quality. Always double-check your multimedia content to make sure it isn’t blurry after the compression.

How to fix a 400 Bad Request error in Google Chrome

To fix a 400 Bad Request error in Google Chrome, start by deleting your cookies and cached files. Open the three-dot menu in the top-right corner, select Delete browsing data, choose All time as the time range, select Cookies and other site data and Cached images and files, and click Delete data.

If the error persists, try these Chrome-specific checks:

  • Open an incognito window: Press Ctrl+Shift+N on Windows or Cmd+Shift+N on macOS and load the page again. If it works, your cookies or extensions are the likely cause.
  • Turn off extensions: Open the three-dot menu, go to Extensions → Manage Extensions, and turn off extensions one by one to find the culprit.
  • Clear Chrome’s DNS cache: Type chrome://net-internals/#dns in the address bar and click Clear host cache.
  • Update Chrome: Open the three-dot menu, go to Help → About Google Chrome, and install any available update.

You can also force a hard refresh with Ctrl+Shift+R on Windows or Cmd+Shift+R on macOS, which reloads the page without using cached files.

How to fix a 400 Bad Request error on your website

If a 400 error appears for many visitors, in every browser, or only on specific forms or pages of your site, the cause is likely server-side. Fixing it quickly matters, since errors cost conversions: in Baymard Institute’s checkout research, 13% of shoppers who abandoned an order said the site crashed or showed errors.

1. Find the failing request in your browser’s developer tools

Browser developer tools show which request returns the 400 status code and what the browser sent with it. Press F12 in Chrome, Firefox, or Edge, open the Network tab, and reload the page.

Select the request with the 400 status to inspect its URL, request headers, cookies, and payload. Oversized Cookie headers, malformed query strings, and invalid form data are common findings.

2. Check your server and application logs

Server error logs often record why a request was rejected, which the browser’s generic error page doesn’t show. Open your web server’s error log in your hosting control panel or on the server, and look for entries that match the time of the failed request.

If you run a WordPress site, enable WordPress debug mode to log errors from plugins, themes, or custom code. Turn debug mode off again after troubleshooting.

3. Rule out plugin and theme conflicts

WordPress security, caching, and form plugins can reject requests they consider invalid. Back up your site, then deactivate plugins one at a time from Plugins → Installed Plugins, reloading the failing page after each change.

If no plugin causes the error, switch temporarily to a default WordPress theme and test again. Reactivate everything that isn’t responsible once you find the culprit.

4. Review header and upload size limits

Server size limits decide whether large cookies, headers, and uploads are accepted. In Nginx, a request header field larger than one large_client_header_buffers buffer (8 KB by default) returns a 400 error, while a request body above client_max_body_size (1 MB by default) returns a 413 error.

First, reduce the number and size of cookies your site sets, since raising limits only hides bloated headers. If you do raise a limit, test the configuration with nginx -t before reloading the server, or ask your hosting provider if you don’t have server access. For header-specific errors, see how to fix HTTP error 431 Request Header Fields Too Large.

5. Check firewall and CDN rules

A web application firewall (WAF) or content delivery network (CDN) can block requests that match its security rules, and some setups return a 400 status code. Check the WAF or CDN security event log for blocked requests to the affected URL.

Only relax a rule or add an exception after confirming the block is a false positive, since these rules also stop malicious requests.

Next steps: keep your site free of 400 errors

After you apply a fix, retest the original page, form, or upload in an incognito window and in a second browser to confirm the request now succeeds. If you changed server limits or firewall rules, check the server error log over the next few days for new 400 entries.

To catch 4XX errors before visitors report them, crawl your site during a regular SEO audit and review every URL that returns a client error.

This article is a localized version of 400 Bad Request error: what it means & how to fix it, originally published in English.

All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.

Arif is a Technical Content Writer for Hostinger Tutorials with an educational background in Informatics. He specializes in Linux server administration, VPS hosting, and web development, and has authored more than 200 technical articles. Follow him on LinkedIn.

Simon is a dynamic Content Writer who loves helping people transform their creative ideas into thriving businesses. With extensive marketing experience, he constantly strives to connect the right message with the right audience. In his spare time, Simon enjoys long runs, nurturing his chilli plants, and hiking through forests. Follow him on LinkedIn.

Trusted by 4+ million website owners worldwide

See our 74,073 reviews on Trustpilot