Creative agency glossaryWeb, UX/UI, and Design

400 Bad Request

A 400 Bad Request is the HTTP status code a server returns when it cannot understand the request it was sent, usually because the request itself was malformed.

What is a 400 Bad Request error?

Every time a browser or an app asks a server for something, the server answers with a three-digit status code. Codes in the 200s mean success, 300s mean a redirect, 500s mean the server failed. The 400s mean the request was the problem, and 400 Bad Request is the most general of them: the server read the request, could not make sense of it and refused to proceed.

The causes are mundane. A URL with characters the server does not accept, or one that is simply too long. A request header or a cookie that has grown past the size limit, which is common on sites that set many cookies. A form or an API call sending data in the wrong format, such as invalid JSON. A corrupted cache or an expired session cookie that no longer parses. A file upload larger than the server allows, which some servers report as 400 rather than the more specific 413.

It is different from its neighbors. A 401 means the request needs authentication, a 403 means the server understood but refuses, a 404 means the page does not exist. A 400 means the request never got far enough to be judged on any of those.

Why it matters

Why a 400 Bad Request matters

For a visitor a 400 is a dead end with no explanation. The page they wanted is replaced by a line of text, and most people leave. For a brand it is a form that silently fails, a checkout that stops, a campaign landing page that returns an error for everyone who arrives with a mistyped tracking link. For a developer it is a signal that something between the browser and the server is broken, and it is often the first visible symptom of a bigger problem.

Search engines notice too. If a crawler receives 400 responses from pages that used to work, those pages drop from the index, and a site that returns errors to a crawler looks neglected. On a campaign, a 400 on the destination page is the fastest way to waste a media budget.

In practice

How a 400 Bad Request works in practice

  1. 01

    Diagnosing a 400 starts with reproducing it. If it happens only in one browser, clearing cookies and cache usually fixes it, because the stored data was the broken part. If the URL is unusual, it is checked for stray characters, bad encoding or excessive length. If it comes from an application or an API call, the request body is compared with what the server expects, and the server logs show exactly what was rejected and why. The browser's developer tools reveal the request and the response side by side.

  2. 02

    Preventing it is the developer's job. Inputs are validated before they are sent, cookies are kept small, URLs are built carefully, and the error page for a 400 is designed like any other page, with the brand on it and a way back. The right code is also chosen honestly: a 400 should mean a bad request, not be the catch-all for every error a server cannot be bothered to name.

Watch out

What people get wrong about 400 Bad Request errors

Blaming the server, when a 400 by definition means the request was at fault, even if the fault was a cookie the server set in the first place. Using 400 as a generic error for everything, which hides the real cause from everyone who has to debug it. Ignoring the errors in the logs because the site looks fine to the people in the office, who have the right cookies. Leaving the default error page, so a visitor sees a line of server text instead of the brand. And forgetting that campaign links, shortened URLs and tracking parameters are a common source, so a launch is the moment to test them.

Questions

People also ask

How do I fix a 400 Bad Request error on my own website?

Check the server logs for the rejected request, test the URL for bad characters or excessive length, and check whether cookies or headers have grown too large. If an app or form is sending data, validate it against what the server expects. Most 400s trace back to one malformed input.

What causes a 400 error when I am just visiting a site?

Usually a stale or oversized cookie, a corrupted cache or a mistyped link. Clearing cookies for that site and reloading fixes most cases. If it persists across browsers, the problem is on the site's side and there is nothing a visitor can do.

Does a 400 error hurt SEO?

A page that returns 400 to a crawler will fall out of the index, and a pattern of errors makes a site look poorly maintained. One-off 400s from bad links are harmless; persistent ones on real pages are not.

What is the difference between a 400 and a 404?

A 404 means the request was fine but the page does not exist. A 400 means the request itself could not be understood, so the server never got as far as looking for a page. A 404 is about the destination; a 400 is about the message.

Next to it in the glossary

  1. 451 Unavailable for Legal ReasonsA 451 Unavailable for Legal Reasons is the HTTP status code a server returns when it is refusing to show a page because a law, a court order or a government demand says it cannot.
  2. Above the FoldAbove the fold is the part of a web page that is visible before anyone scrolls: the first screen a visitor gets, and the one that decides whether they stay.
  3. Back-End DevelopmentBack-end development is the building of the server-side systems, databases and logic that run behind a website or app and make everything on the screen work.
  4. Below the FoldBelow the fold is the part of a web page a visitor only sees after scrolling, a term borrowed from newspapers, where the lower half of the front page is hidden when the paper lies folded on the stand.
  5. Content Delivery Network (CDN)A content delivery network (CDN) is a set of servers spread around the world that stores copies of a website's files and serves each visitor from the one nearest to them.
  6. Custom FieldA custom field is an extra piece of structured data attached to a page, post or product in a content management system, beyond the standard title, body and image.

Every Web, UX/UI, and Design term →

In the work

Where it shows up

All our creations →

From the journal

Read around it

The journal →

Talking the talk is one thing

We make the work.

RIOT is a creative agency and production studio in New York. Strategy, brand, film, photography, design and the campaigns that carry them, made by one team. A few lines is enough to start: we read every brief the same day.

    Footage