What is HTTP Status Code?
A three-digit integer in an HTTP response that indicates the result of the server's attempt to process the request, grouped into five classes (1xx through 5xx).
An HTTP status code is a three-digit integer that the server includes in the first line of an HTTP response to communicate the result of processing the client's request. The first digit defines the class of response. There are five classes defined in the HTTP specification: 1xx (Informational), 2xx (Successful), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error). The remaining two digits do not carry any hierarchical meaning.
The status code is placed in the status line of the response, for example 'HTTP/1.1 200 OK'. The numeric code is intended to be processed automatically by clients, while the accompanying reason phrase (e.g., 'OK', 'Not Found') is a human-readable text that servers may customize, though the RFC recommends standard phrases for interoperability. The code defines semantics for both the client and any intermediate proxies. For instance, a 304 Not Modified response tells a cache that it can serve its stored copy; a 301 Moved Permanently tells a client to update its bookmark.
Status codes are extensible. The core set was defined in RFC 7231, which superseded earlier RFCs like 2616. Additional codes have been added by other RFCs, like 451 (Unavailable For Legal Reasons) from RFC 7725, and 103 (Early Hints) from RFC 8297. The HTTP specification does not limit total codes, but new codes must be registered with the IANA. Developers often see status codes as the first indicator of a request's fate. In practice, many web frameworks and APIs rely on a small subset, primarily 200, 201, 204, 301, 302, 400, 401, 403, 404, 500, and 502, but new services often use less common codes for fine-grained signaling.
Key facts
- Status codes are grouped by first digit: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error), 5xx (server error).
- The HTTP specification (RFC 7231) defines the standard set; new codes are registered with IANA.
- Clients use the numeric code for automatic handling; the reason phrase is optional and non-normative.
- Codes are extensible, allowing new semantics without breaking older clients that ignore unknown codes.
- Most common codes include 200, 301, 400, 404, and 500.
How it works in practice
Related terms
References
More in Web Protocols
CORS
CORS (Cross-Origin Resource Sharing) is a browser security mechanism that lets servers explicitly allow web pages from one origin to request resources from a different origin via HTTP response headers.
GraphQL
GraphQL is a query language and runtime for APIs that lets clients request exactly the data they need in a single round trip, reducing over-fetching and under-fetching.
gRPC
gRPC is a high-performance, open-source remote procedure call framework initially developed by Google. It uses HTTP/2 for transport, Protocol Buffers as its interface definition language and message serialization format, and supports bidirectional streaming.
HTTP
HTTP is a text-based request-response protocol that defines how web clients and servers exchange resources, forming the foundation of data communication on the World Wide Web.
HTTP Pipelining
HTTP Pipelining is a technique in HTTP/1.1 that sends multiple requests on a single connection without waiting for each response, now largely replaced by HTTP/2 multiplexing.
HTTP/1.1
HTTP/1.1 is the persistent-connection version of the Hypertext Transfer Protocol, defined in RFC 2616 and updated by RFCs 7230-7235, enabling multiple requests and responses over a single TCP connection.
HTTP/2
HTTP/2 is a binary, multiplexed version of HTTP that reduces latency through header compression, stream prioritization, and server push, as defined in RFC 7540.
HTTP/3
HTTP/3 is the third major version of the Hypertext Transfer Protocol, which runs over QUIC instead of TCP to reduce latency, eliminate head-of-line blocking, and improve connection setup time.
HTTPS
HTTPS (HTTP Secure) is HTTP traffic encrypted inside a TLS session, protecting data confidentiality, integrity, and server authenticity between a client and a web server.
Keep-Alive
Keep-Alive, also called persistent connection, allows multiple HTTP requests and responses over a single TCP connection, reducing latency and overhead compared to opening a new connection per request.