What Does HTTP Error 400 Mean
The 400 Bad Request or 400 Invalid Request error indicates that the server did not understand your request. Unlike hosting-side errors (like the 500 series), this status code directly points to a problem with the data sent by your browser or application. In simple terms: you requested information, but the server rejected it due to an invalid format.
This message most often appears when following a link, submitting a web form, logging into a site, or calling a REST API. You will see the 400 status in the address bar and 400 Invalid Request in the developer console.
Common Causes
The server returns this code only if the request violates basic HTTP rules. Here are the specific triggers:
- Incorrect URL syntax. The address contains forbidden characters, spaces, Cyrillic characters without URL encoding, or extra slashes.
- Corrupted or outdated cookies. The browser sends stale session tokens or files that exceed the allowed header size (typically 4–8 KB).
- Exceeding data size limits. You are trying to upload a file or send JSON/XML that exceeds the server's configured limits.
- Conflicting network extensions. Ad blockers, VPN clients, or User-Agent modifiers automatically substitute request headers, making them invalid.
- Data format mismatch. The client sends data in
UTF-8encoding, but the server expects a different one, or the request body structure is broken.
Solutions
Solution 1: Check and Fix the URL
Start with the most obvious thing. If you typed the address manually or copied it from an external source, check the string for typos.
- Ensure there are no accidental spaces or characters like
%20at the end of the address. - If the URL contains Cyrillic characters, the browser should automatically encode them into a format like
%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82. If this didn't happen, use an online URL encoder or replace Russian letters with Latin equivalents. - Press
Enterto reload. Often, this is enough for the browser to generate a clean request.
💡 Tip: If you are developing an API, inspect the request body using Postman or
curl. Ensure theContent-Typematches the actual data (e.g.,application/json).
Solution 2: Clear Browser Cache and Cookies
Outdated session files are the most common cause of a 400 error on working websites.
- Press
Ctrl + Shift + Delete(Windows/Linux) orCmd + Shift + Delete(macOS). - In the window that opens, select the time range
All time. - Check the boxes for "Cookies and other site data" and "Cached images and files".
- Click "Clear data" and restart your browser.
After clearing, the site will ask you to log in again. Enter your credentials—this will create a new, valid session without corrupted headers.
Solution 3: Temporarily Disable Extensions
If clearing data didn't help, check if third-party software is interfering with HTTP traffic.
- Open your browser in incognito mode (
Ctrl + Shift + NorCmd + Shift + N). - Navigate to the problematic site. In this mode, most extensions are disabled by default.
- If the site loads without an error, go to the
Extensionssection (chrome://extensions/or equivalent) and disable them one by one, reloading the page after each. - Identify the culprit. Often, these are old VPN plugins, header modifiers, or aggressive tracker blockers. Update or remove them.
Solution 4: Check the Size and Format of Uploaded Data
A 400 error often occurs when trying to upload an attachment to a portal or submit a form.
- Check the file size. Most web servers limit uploads by default to 2–10 MB. If the file is larger, the server will terminate the connection.
- Change the file extension. Try archiving the document into
.zipor.rar. Sometimes servers block.exeor.batfiles for security reasons, returning400 Invalid Requestinstead of an explicit denial. - If you are working with an API, ensure the JSON is valid. Use online validators or the
jq . < request.jsoncommand in the terminal to find a missing comma or quote.
Prevention
To prevent a 400 error from recurring, follow a few simple rules. Regularly update your browser to the latest version: developers constantly fix bugs in network header handling. Do not manually edit URLs unless you know URL encoding rules. When working with web forms, check the file upload limits in the service's documentation. Finally, periodically clear cookies for rarely visited sites—this prevents the accumulation of stale tokens that the server no longer recognizes.