HTTP Status Codes

The secret language of the web. Learn what 404, 500, and 200 really mean for your servers.

API Request Simulator

Send requests and see how the server responds.

Browser
Server
Waiting for request...
1001xx

Continue

The server has received the request headers and the client should proceed to send the request body.

1011xx

Switching Protocols

The requester has asked the server to switch protocols and the server has agreed to do so.

2002xx

OK

The request has succeeded. The meaning of the success depends on the HTTP method.

2012xx

Created

The request has succeeded and a new resource has been created as a result.

2042xx

No Content

The server successfully processed the request, but is not returning any content.

3013xx

Moved Permanently

The URL of the requested resource has been changed permanently. The new URL is given in the response.

3023xx

Found

This response code means that the URI of requested resource has been changed temporarily.

3043xx

Not Modified

Indicates that the resource has not been modified since the version specified by the request headers.

4004xx

Bad Request

The server could not understand the request due to invalid syntax.

4014xx

Unauthorized

Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated".

4034xx

Forbidden

The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource.

4044xx

Not Found

The server can not find the requested resource. In the browser, this means the URL is not recognized.

4184xx

I'm a Teapot

The server refuses the attempt to brew coffee with a teapot. An April Fools joke from 1998.

4294xx

Too Many Requests

The user has sent too many requests in a given amount of time ("rate limiting").

5005xx

Internal Server Error

The server has encountered a situation it does not know how to handle.

5025xx

Bad Gateway

This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.

5035xx

Service Unavailable

The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded.

5045xx

Gateway Timeout

This error response is given when the server is acting as a gateway and cannot get a response in time.

How The Web Talks

Imagine the internet as a conversation. Your browser asks a question ("Get me this image"), and the server replies with a number. That number is the Status Code.

These 3-digit integers (defined by RFC 9110) tell the client everything it needs to know about the result. Was the image found? (200). Was it moved? (301). Is the server on fire? (500). Mastering these codes is the first step to becoming a Backend Developer or SEO Expert.

The Five Families

The first digit tells you everything you need to know about who is responsible for the result.

  • 1xxHold on, I'm working on it.
  • 2xxSuccess! Here is your data.
  • 3xxGo away (This moved somewhere else).
  • 4xxYou messed up (Bad Request).
  • 5xxI messed up (Server Error).

Security Implications

Choosing the right code matters for security.

Never send a 500 Error with a "Stack Trace" to a user. It reveals your code structure to hackers. Instead, log the error internally and send a generic 500 page. Also, be careful differentiating between 401 and 404 on login pages, as it might leak whether a username exists.

Common Developer Scenarios

The Redirect Loop

If Page A redirects to Page B, and Page B redirects back to Page A, the browser will eventually give up with "ERR_TOO_MANY_REDIRECTS". This is usually a configuration error with 301/302 codes.

Rate Limiting (429)

If your API clients start receiving 429 errors, your script is running too fast. Implement "Exponential Backoff" (waiting longer between each retry) to respect the server's limits.

The Dreaded 504

502 and 504 errors often happen when you use Nginx or Cloudflare. It means the "Frontend" server is fine, but the "Backend" (where your database lives) is unresponsive. Check your database logs first!


Frequently Asked Questions

What is the most common HTTP status code?

200 OK is the most common code, signifying a successful request. However, you often don't see it because it just means the page loaded normally.

Why do I see a 404 error?

A 404 "Not Found" error means the server is reachable, but the specific page or file you requested does not exist. This happens if you click a broken link or make a typo in the URL.

What is the difference between 401 and 403?

401 Unauthorized means "I don't know who you are" (Authentication failed). 403 Forbidden means "I know who you are, but you aren't allowed here" (Authorization failed).

How do 301 Redirects affect SEO?

A 301 Moved Permanently response tells search engines (like Google) to transfer all "Ranking Power" (link juice) from the old URL to the new one. Use this when permanently moving a page.

What causes a 500 Internal Server Error?

A 500 error is a generic "catch-all" for server-side crashes. It usually means there is a bug in the code (e.g., PHP, Python, Node.js) or a database connection failure.

What is a 503 error?

503 Service Unavailable often means the server is overloaded or down for maintenance. It is usually temporary.

What is a "Soft 404"?

A Soft 404 occurs when a page displays "Page Not Found" text to the user but sends a "200 OK" code to the crawler. This is bad for SEO; always send a real 404 header.

What is status code 418?

418 "I'm a teapot" is an April Fools' joke response code defined in 1998 (RFC 2324). It is rarely used seriously but is a favorite easter egg for developers.

What does 504 Gateway Timeout mean?

It means one server (the Gateway) tried to access another server (the Upstream) but didn't get a response in time. This often happens with Nginx proxies.

What is a 201 Created code?

201 Created is returned (usually by POST requests) to indicate that the request succeeded and a new resource (like a User or Post) has been created.

When should I use 204 No Content?

Use 204 when a request (like DELETE or PUT) was successful, but there is no specific data to return to the client. It saves bandwidth.

What is status code 304?

304 Not Modified tells the browser "Your cached version is still good, don't download the file again." This speeds up web browsing significantly.

What is a 429 Too Many Requests?

This is returned when you exceed a Rate Limit (e.g., calling an API 100 times per second). You must wait before trying again.

What is a 405 Method Not Allowed?

This means you tried to use an HTTP method that isn't supported for this route. For example, sending a POST request to a read-only endpoint that acts only on GET.

What is the difference between 502 and 504?

502 Bad Gateway means the upstream server sent an invalid response. 504 Gateway Timeout means the upstream server sent no response (it hung).