HTTP Status Codes

Quick reference for every HTTP status code. Search by number or keyword, click to expand details.

HTTP Status Code Categories

HTTP status codes are three-digit numbers returned by a server in response to a client request. They are grouped into five categories:

Most Common HTTP Errors and How to Fix Them

400 Bad Request

Check your request syntax, headers, and body. Validate JSON payloads and ensure Content-Type headers match the data format.

401 Unauthorized

Provide valid authentication credentials. Check that your API key, token, or session cookie is correct and not expired.

403 Forbidden

You are authenticated but lack permission. Verify your role, file permissions on the server, or CORS configuration.

404 Not Found

Double-check the URL. Look for typos, trailing slashes, or changed endpoints. Set up redirects for moved pages.

500 Internal Server Error

Check server logs for the actual error. Common causes: unhandled exceptions, database connection failures, or misconfigured environment variables.

502 Bad Gateway

The reverse proxy or load balancer received an invalid response from the upstream server. Check that the upstream service is running and healthy.

503 Service Unavailable

The server is temporarily overloaded or under maintenance. Implement retry logic with exponential backoff on the client side.

API Status Code Best Practices

Frequently Asked Questions

What does a 403 vs 401 mean?

A 401 Unauthorized means the request lacks valid authentication -- the server does not know who you are. A 403 Forbidden means the server knows your identity but you do not have permission to access that resource. Think of 401 as "please log in" and 403 as "access denied."

When should I use 301 vs 302?

Use 301 Moved Permanently when a resource has permanently moved and you want search engines and clients to update their references to the new URL. Use 302 Found for temporary redirects where the original URL will be valid again. For modern APIs, prefer 308 (permanent) and 307 (temporary) as they preserve the HTTP method.

What is a 418 status code?

HTTP 418 "I'm a Teapot" was an April Fools' joke from RFC 2324 (1998) defining the Hyper Text Coffee Pot Control Protocol. The server refuses to brew coffee because it is a teapot. It is not a real standard, but it lives on as a beloved Easter egg in many HTTP libraries and APIs.