HTTP Fundamentals

Understanding HTTP Status Codes: A Complete Guide

A comprehensive introduction to HTTP status codes — what they are, how they're organized into classes (1xx-5xx), and why they matter.

What Are HTTP Status Codes?

Every time your browser requests a web page, the server responds with a three-digit number called a status code. This code tells the client what happened with the request.

The Five Classes

HTTP status codes are organized into five classes:

1xx — Informational

The server received the request and is continuing to process it. The most common is 100 Continue, which tells the client to proceed with sending the request body.

2xx — Success

The request was successfully received, understood, and accepted. 200 OK is the standard success response. 201 Created indicates a new resource was created. 204 No Content means success with no response body.

3xx — Redirection

The client must take additional action to complete the request. 301 Moved Permanently redirects to a new URL forever. 302 Found is a temporary redirect. 304 Not Modified tells the client to use its cached copy.

4xx — Client Error

The request contains an error on the client side. 400 Bad Request means malformed syntax. 401 Unauthorized requires authentication. 403 Forbidden means authenticated but not allowed. 404 Not Found — the resource doesn't exist. 429 Too Many Requests means rate limiting is in effect.

5xx — Server Error

The server failed to fulfill a valid request. 500 Internal Server Error is a generic server failure. 502 Bad Gateway means a proxy received an invalid response from upstream. 503 Service Unavailable — the server is overloaded or down for maintenance. 504 Gateway Timeout — an upstream server didn't respond in time.

Key Takeaway

Understanding status code classes helps you quickly diagnose issues: 4xx means fix the client, 5xx means fix the server, 3xx means follow the redirect.

Related Protocols

Related Glossary Terms

More in HTTP Fundamentals