HTTP Status Codes
Complete reference for all HTTP response status codes
1xx — Informational
Continue
The server has received the request headers and the client should proceed to send the request body.
Switching Protocols
The server agrees to switch protocols as requested by the client (e.g. HTTP to WebSocket).
Processing
The server has received and is processing the request, but no response is available yet (WebDAV).
Early Hints
Used to return some response headers before final HTTP message, allowing the client to start preloading resources.
2xx — Success
OK
The request succeeded. The meaning of success depends on the HTTP method: GET fetched the resource, POST transmitted the entity.
Created
The request succeeded and a new resource was created. Typically the response of POST or PUT requests.
Accepted
The request has been received but not yet acted upon. It is non-committal; the server may process or discard the request.
Non-Authoritative Information
The returned metadata is not exactly the same as what was available from the origin server, but collected from a local or third-party copy.
No Content
There is no content to send for this request. Often used in DELETE or PUT responses where no body is returned.
Reset Content
Tells the client to reset the document which sent this request, e.g. clear a form after submission.
Partial Content
This response is used when the Range header is sent by the client to request only part of a resource.
Multi-Status
Conveys information about multiple resources, for situations where multiple status codes might be appropriate (WebDAV).
Already Reported
Used inside a DAV binding to avoid repeatedly enumerating the internal members of multiple bindings to the same collection (WebDAV).
IM Used
The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations.
3xx — Redirection
Multiple Choices
The request has more than one possible response. The user agent should choose one of them.
Moved Permanently
The URL of the requested resource has been changed permanently. The new URL is given in the response.
Found
The URI of requested resource has been changed temporarily. The client should continue to use the original URI.
See Other
The server sent this response to direct the client to get the requested resource at another URI with a GET request.
Not Modified
Used for caching. It tells the client that the response has not been modified, so the client can continue to use the same cached version.
Temporary Redirect
The server sends this response to direct the client to get the requested resource at another URI with the same method that was used in the prior request.
Permanent Redirect
This means that the resource is now permanently located at another URI. Similar to 301 but the method is not allowed to change.
4xx — Client Error
Bad Request
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax).
Unauthorized
The client must authenticate itself to get the requested response. Similar to "login required".
Payment Required
Reserved for future use. Originally intended for digital payment systems; now used by some APIs for quota exceeded.
Forbidden
The client does not have access rights to the content. Unlike 401, the client's identity is known to the server.
Not Found
The server cannot find the requested resource. URLs that are not recognized by the server return this code.
Method Not Allowed
The request method is known by the server but is not supported by the target resource (e.g., a GET-only endpoint receives POST).
Not Acceptable
The server cannot produce a response matching the list of acceptable values defined in the request's headers.
Proxy Authentication Required
Authentication is needed to be done by a proxy server.
Request Timeout
The server would like to shut down the unused connection. Some servers send this on idle connections.
Conflict
A request conflicts with the current state of the server (e.g., two clients trying to update the same resource simultaneously).
Gone
The requested content has been permanently deleted from the server, with no forwarding address. Different from 404 — this is intentional and permanent.
Length Required
Server rejected the request because the Content-Length header field is not defined and the server requires it.
Precondition Failed
The client has indicated preconditions in its headers which the server does not meet.
Content Too Large
Request entity is larger than limits defined by server. The server might close the connection or return a Retry-After header.
URI Too Long
The URI requested by the client is longer than the server is willing to interpret.
Unsupported Media Type
The media format of the requested data is not supported by the server.
Range Not Satisfiable
The range specified by the Range header field in the request cannot be fulfilled; it's possible that the range is outside the size of the target data.
Expectation Failed
The expectation indicated by the Expect request header field cannot be met by the server.
I'm a Teapot
The server refuses to brew coffee because it is, permanently, a teapot. An April Fools' joke in RFC 2324, sometimes used as an Easter egg.
Misdirected Request
The request was directed at a server that is not able to produce a response. This may be sent by a server that is not configured to produce responses for the combination of scheme and authority.
Unprocessable Content
The request was well-formed but was unable to be followed due to semantic errors. Common in REST APIs for validation failures.
Locked
The resource that is being accessed is locked (WebDAV).
Failed Dependency
The request failed due to failure of a previous request (WebDAV).
Too Early
Indicates that the server is unwilling to risk processing a request that might be replayed.
Upgrade Required
The server refuses to perform the request using the current protocol but might do so after the client upgrades to a different protocol.
Precondition Required
The origin server requires the request to be conditional. Intended to prevent the "lost update" problem.
Too Many Requests
The user has sent too many requests in a given amount of time (rate limiting).
Request Header Fields Too Large
The server is unwilling to process the request because its header fields are too large.
Unavailable For Legal Reasons
The user agent requested a resource that cannot legally be provided, such as a web page censored by a government.
5xx — Server Error
Internal Server Error
The server has encountered a situation it does not know how to handle. A generic "something went wrong" error.
Not Implemented
The request method is not supported by the server and cannot be handled. The only methods required by servers are GET and HEAD.
Bad Gateway
The server, while working as a gateway to get a response needed to handle the request, got an invalid response.
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.
Gateway Timeout
The server is acting as a gateway and cannot get a response in time from the upstream server.
HTTP Version Not Supported
The HTTP version used in the request is not supported by the server.
Variant Also Negotiates
The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself.
Insufficient Storage
The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request (WebDAV).
Loop Detected
The server detected an infinite loop while processing the request (WebDAV).
Not Extended
Further extensions to the request are required for the server to fulfill it.
Network Authentication Required
Indicates that the client needs to authenticate to gain network access. Intended for use by intercepting proxies (e.g. captive portals).
What are HTTP Status Codes?
HTTP status codes are standardized 3-digit numbers returned by a web server in response to a client's request. They indicate whether the request was successful, redirected, or encountered an error. Status codes are grouped into five classes: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client errors), and 5xx (server errors). Understanding these codes is essential for web development, API design, and debugging.
How to Use This Reference
- Search by code number (e.g. “404”), name (e.g. “not found”), or description keyword
- Filter by category using the buttons above
- Click any card to read the full description
HTTP Status Code Categories
- 1xx Informational — Request received, continuing process
- 2xx Success — Request successfully received, understood, and accepted
- 3xx Redirection — Further action needed to complete the request
- 4xx Client Error — Request contains bad syntax or cannot be fulfilled
- 5xx Server Error — Server failed to fulfill an apparently valid request
Frequently Asked Questions
What is the difference between 401 and 403?
401 Unauthorized means the client is not authenticated — it needs to log in or provide credentials.403 Forbidden means the client is authenticated but does not have permission to access the resource.
What is the difference between 301 and 302?
301 Moved Permanently tells the browser and search engines the resource has permanently moved.302 Found is a temporary redirect — the original URL is still valid and should be used in the future. Use 301 for SEO-friendly permanent redirects.
When should I use 422 instead of 400?
Use 400 Bad Request when the request syntax is malformed (e.g. invalid JSON). Use 422 Unprocessable Content when the request is well-formed but fails validation (e.g. a required field is missing or an email format is wrong). Many REST APIs use 422 for validation errors.
What causes a 502 Bad Gateway?
A 502 occurs when a proxy or load balancer receives an invalid response from an upstream server. Common causes include a crashed application server, a misconfigured reverse proxy (nginx/Apache), or a temporary overload. It differs from 504, which is a timeout rather than an invalid response.