1. Semrush
  2. Blog
  3. SEO
  4. Technical SEO

What Is a 400 Bad Request? Definition, Causes, & How to Fix

Author:Vlado Pavlik

5 min read

April 7, 2025

Contributor: Christine Skopec

What Is a 400 Error?

A 400 bad request error is when a browser sends a request to a web server, and the server can’t understand or process it correctly.

It’s a type of HTTP response status code. And codes starting with 4xx usually indicate an error on the client side—meaning the issue is coming from what’s making the request (browser, app, etc.).

There are many different messages servers use to indicate a 400 status code, including:

The error looks something like this, depending on your browser:

400 bad request error page with error highlighted

Let’s dive into the common causes of 400 bad requests and how to fix them.

HTTP 400 Error Causes & How to Fix Them

Here are the most common causes of 404 bad request errors—and their solutions:

1. URL String Errors or Other Invalid Syntax

One of the most common causes of a 400 Bad Request error is a problem in the URL—like extra spaces or special characters such as“&,” “%”, and “#.”

Sometimes, the URL is too long and complex. Browsers have character limits (e.g., up to ~2,000 characters on Chrome), and exceeding these limits can trigger 400 errors.

Arrow pointing to unsupported special character in URL causing the 400 bad request error

Errors can also be due to invalid syntax outside of the URL that breaks standard rules.

This often happens when there's a missing or incorrect HTTP header in the request, which prevents the server from interpreting or processing it.

For example, the below GET request (which asks for data from the specified resource) has an improperly formatted header:

GET / HTTP/1.1Host example.comUser-Agent: Mozilla/5.0Accept: text/html

In this case, the Host header is missing a colon.

How to Fix It

If you’re a regular site visitor:

For website owners and developers:

Chrome web developer tools Network tab open and Headers tab selected with Status Code error highlighted for 400 bad request error page

2. Corrupt or Invalid Cookies

When cookies (small data files websites store on your device) expire or get damaged, they can cause 400 errors.

How to Fix It

If you’re a regular site visitor:

For website owners and developers:

3. Browser Extensions

Browser extensions can interfere with how your browser communicates with website servers in ways that lead to 400 bad requests.

For example, ad blockers might prevent necessary scripts that a website requires to function properly from loading. Or, privacy extensions might modify or block cookies that the site needs for processing a request correctly.

How to Fix It

Chrome extensions management page with Developer mode toggled on and arrow pointing to Update button

4. Outdated DNS Cache

The domain name system (DNS) translates domain names (such as “www.yoursite.com”) into IP addresses (e.g., 192.168.1.1).

Your device stores these records in its DNS cache. But these records can become outdated if a site’s IP address changes.

When this occurs and you visit that same site, your computer sends the request to the old IP address that no longer exists instead of the new IP address.

How to Fix It

To remove outdated records that could be causing 400 errors, flush your DNS cache.

Here’s how to do it on Windows:

Open the “Start” menu and type “cmd” in the search bar.

With “Command Prompt” selected, click “Run as Administrator.”

Windows 11 Start menu with 'cmd' typed in search bar and Run as administrator option for Command Prompt highlighted

You may be prompted to allow access. If so, select “Yes.”

In the Command Prompt window that opens, enter the command “ipconfig /flushdns” and press the “Enter” key.

You’ll then see a message confirming the DNS Resolver Cache has been successfully flushed:

Administrator mode command prompt window showing success message for DNS resolver cache flush command

Now, try accessing the page again to see if the problem has been resolved.

5. Server Issues

Sometimes, 400 errors can actually be caused by the server. This happens when the server is configured incorrectly and interprets valid requests as invalid.

For example, a server might be set up to reject requests containing certain words that it wrongly identifies as security threats. Or, it might have outdated rules that don't work with modern browsers.

How to Fix It

If you’re a regular site visitor:

For website owners and developers:

6. File Size Limits

A common reason for getting a 400 error is if you try to upload a file that’s too large to your website.

For example, uploading an image, video, or document file over the size limit to a WordPress site can lead to a 400 error.

In WordPress, you can check your file size limit by clicking on “Media” > “Library,” and then “Add New Media File” in the left-hand column.

You should then see something like this:

WordPress admin dashboard with Media Library page open, Add New Media File button clicked, and Maximum upload file size limit highlighted.

How to Fix It

Reduce the file size to below your limits to ensure the server can complete your request.

Host your videos on YouTube or Vimeo, upload your audio files to SoundCloud, or compress your images using a tool like Compress Image to stay within your limits more easily.

Find & Fix 4xx Errors on Your Site

Ideally, you’ll want to audit your site to find errors like 400 bad requests beforethey affect performance and annoy site visitors.

Semrush’s Site Audit tool can help.

Open the tool, follow the configuration settings, and go to the “Issues” tab. Type “4xx” into the search bar to find a list of 4XX errors, then click on the pages.

Semrush Site Audit Issues page with '4xx' in search bar and errors section showing 4 pages returned 4xx status code row

You’ll find a list of the pages affected and their error codes (the tool shows more than just 400 errors):

List of pages that returned 4xx status code

Then, apply what you learned in this article to fix the errors.

Find and Fix 400 Errors

with the Site Audit Tool

Try for Free

Share

Author Photo

Vlado Pavlik

Vlado is a content marketer with 10+ years of experience in SEO, content strategy, and building websites for both clients and personal projects. As Content Operations Lead at Semrush, he streamlines workflows and optimizes processes. He also played a key role in scaling content production and shaping the blog Style Guide. Previously, as Head of Content at Mangools, he led initiatives that made the blog a major driver of organic traffic. He enjoys making complex SEO topics accessible to others.

Author Photo

Vlado Pavlik

Vlado is a content marketer with 10+ years of experience in SEO, content strategy, and website building. As Content Operations Lead at Semrush, he focuses on improving content workflows, optimizing processes, and helping scale content production.

Try Semrush
Everything you need to win AI visibility and drive SEO success
Start Free Trial
Unlimited access for 7 days

More on this

Boost your digital marketing efforts
Get free trial