HTTP

Glossary Term

HTTP Status Code

Learn what HTTP status codes are and how they indicate request results. Understand 1xx, 2xx, 3xx, 4xx, and 5xx code classes with common examples.

2 min read beginner

TL;DR: Status codes are the quick summary line of HTTP. They tell the client whether the request worked, what kind of follow-up is needed, and who probably needs to fix the problem.

An HTTP status code is the three-digit number in a response that describes the outcome of a request. It is the first thing most tools, browsers, and developers look at because it gives a compact answer before you read headers or body content.

The Five Classes

  • 1xx: the exchange is still in progress
  • 2xx: the request succeeded
  • 3xx: the client needs to follow a redirect or use cached state
  • 4xx: the request is wrong for the current client context
  • 5xx: the server or one of its dependencies failed

That first digit is the fastest useful signal in HTTP.

Why Status Codes Matter

Status codes do more than describe errors. They influence behavior:

  • browsers follow 3xx redirects
  • API clients retry some 5xx responses
  • auth flows react differently to 401 and 403
  • caches treat 200, 301, and 304 differently

In other words, a status code is not just a label. It is part of the contract between client and server.

Common Examples

  • 200 OK: the request worked
  • 201 Created: the request created something new
  • 304 Not Modified: use your cached copy
  • 400 Bad Request: the request format or data is invalid
  • 401 Unauthorized: valid authentication is still needed
  • 403 Forbidden: the client is known but not allowed
  • 404 Not Found: there is no resource here
  • 429 Too Many Requests: slow down
  • 500 Internal Server Error: something broke on the server

The Human Way To Read Them

If you are debugging, ask:

  • did the server understand the request at all
  • did it accept or reject the client context
  • did it finish the work or fail halfway through
  • should the client retry, redirect, or stop

Those questions map more cleanly to status codes than memorizing numbers in isolation.

A Common Mistake

Many APIs return 200 OK with an error message in the body. That makes clients harder to write because the body says “failure” while the protocol says “success.” Good APIs make the status code and the response body tell the same story.

Related terms: HTTP Response, HTTP Request, HTTP Error Handling

Frequently Asked Questions

What is an HTTP status code?

A status code is the three-digit result attached to an HTTP response. It tells the client whether the request succeeded, needs follow-up work, or failed.

What does 200 OK mean?

200 OK means the request succeeded and the server is returning the requested representation or confirmation.

What does 404 Not Found mean?

404 means the server cannot find the target resource at that URL. The route may be wrong, deleted, or never existed.

What does 500 Internal Server Error mean?

500 means the server failed while handling a request that reached it successfully. It is a generic server-side failure, not a client mistake.

Keep Learning