Skip to content

/codes/http/http-status-codes

HTTP status codes: 1xx to 5xx with meaning and common causes

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · curl 8.21.0 (x86_64-w64-mingw32) libcurl/8.21.0 Schannel zlib/1.3.2updated 2026-10-20
tool
HTTP
versions
RFC 9110
os
any

HTTP status codes are three-digit numbers grouped by their first digit: 1xx informational, 2xx success, 3xx redirection, 4xx client error (fix the request) and 5xx server error (the server failed a valid request). The official registry is maintained by IANA; RFC 9110 defines the core codes.

Most used codes

CodeReason phraseWhen you see it
200OKsuccess with a body
201Createdresource created; Location header points to it
204No Contentsuccess without a body (DELETE, PUT)
301Moved Permanentlypermanent redirect; clients may change POST to GET
302Foundtemporary redirect; clients may change POST to GET
304Not Modifiedcached copy is still valid (ETag / If-Modified-Since)
307Temporary Redirecttemporary, method and body preserved
308Permanent Redirectpermanent, method and body preserved
400Bad Requestmalformed syntax or invalid body
401Unauthorizedmissing or invalid credentials (authentication)
403Forbiddenauthenticated but not allowed (authorization)
404Not Foundno resource at this URL
405Method Not Allowedmethod not supported; Allow header lists valid ones
409Conflictstate conflict, for example a duplicate or a version clash
413Content Too Largebody exceeds the server limit (was Payload Too Large)
415Unsupported Media Typewrong Content-Type
422Unprocessable Contentwell-formed but semantically invalid
429Too Many Requestsrate limited; Retry-After may tell you when to retry
500Internal Server Errorunhandled exception on the server
502Bad Gatewaya proxy got an invalid response from the upstream
503Service Unavailableoverloaded or in maintenance
504Gateway Timeouta proxy waited too long for the upstream

Reason phrases as Node.js knows them

bash
node -e '
const { STATUS_CODES } = require("http");
for (const code of [200, 204, 301, 304, 308, 401, 403, 404, 413, 418, 422, 429, 500, 502, 503, 504]) {
  console.log(code, STATUS_CODES[code]);
}'

Output

200 OK
204 No Content
301 Moved Permanently
304 Not Modified
308 Permanent Redirect
401 Unauthorized
403 Forbidden
404 Not Found
413 Payload Too Large
418 I'm a Teapot
422 Unprocessable Entity
429 Too Many Requests
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout

Node.js still uses the older phrases for 413 (Payload Too Large) and 422 (Unprocessable Entity); RFC 9110 renamed them Content Too Large and Unprocessable Content. Reason phrases are informational only: clients must act on the number, and HTTP/2 and HTTP/3 do not transmit a reason phrase at all.

401 vs 403

401 Unauthorized means "who are you?": send credentials (and the response should carry WWW-Authenticate). 403 Forbidden means "I know who you are, and the answer is no": different credentials will not help unless they carry more permissions.

Sources