400
Bad Request
4xx Client Error

What Does HTTP 400 Bad Request Mean?

HTTP 400 Bad Request indicates that the server cannot or will not process the request due to something that the server perceives as a client error. The request itself is malformed — the server cannot even begin to understand what the client wants.

Unlike 401 (authentication) or 403 (authorization), a 400 error means the request structure or data is fundamentally broken. The server is saying: "I cannot make sense of what you sent me." This is one of the most common HTTP errors encountered by both developers and regular users.

Common Causes

How to Fix It

For Developers

For Regular Users

Code Examples

Common API 400 Response

$ curl -i -X POST https://api.example.com/users \ -H "Content-Type: application/json" \ -d '{"name": "Jane", "email": "not-valid"}' HTTP/1.1 400 Bad Request Content-Type: application/json { "error": "validation_error", "details": [ {"field": "email", "message": "Invalid email format"} ] }

Malformed JSON Causing 400

# Trailing comma makes this invalid JSON $ curl -i -X POST https://api.example.com/data \ -H "Content-Type: application/json" \ -d '{"key": "value",}' HTTP/1.1 400 Bad Request {"error": "Malformed JSON in request body"}

Returning 400 in Express.js

app.post('/api/users', (req, res) => { const { name, email } = req.body; if (!name || !email) { return res.status(400).json({ error: 'Missing required fields', required: ['name', 'email'], received: Object.keys(req.body) }); } // ... create user });

Frequently Asked Questions

What causes a 400 Bad Request error?
A 400 error is caused by the client sending a request the server cannot process. The most common triggers: malformed JSON or XML in the request body, missing required fields or parameters, URL containing invalid characters, corrupted browser cookies, or a Content-Type header that does not match the actual body format.
How do I fix a 400 Bad Request as a regular user?
Try these steps in order: 1) Clear your cookies and cache for the specific website. 2) Double-check the URL for typos. 3) Try the page in an incognito/private window. 4) Disable browser extensions. 5) Try a different browser. If the problem persists across browsers and devices, the issue is likely on the server side and you should contact the site owner.
What is the difference between 400 and 422 errors?
400 Bad Request means the request is syntactically broken — the server cannot even parse it (e.g., invalid JSON). 422 Unprocessable Entity (from WebDAV, commonly used in REST APIs) means the request is syntactically correct but contains semantic errors (e.g., valid JSON but "age": -5" fails business logic validation). Use 400 for parse errors, 422 for validation errors.

Related Status Codes

Related Tools