I Know 404, But What's the Difference Between 401 and 403? (HTTP Status Codes)
You've likely encountered a 404 Not Found page while surfing the web.
This number is called an HTTP Status Code, a standard protocol for the server to communicate the result of a client's (browser's) request.
Here is a summary of the essential status codes every developer must know.
1. Categories of Status Codes
Status codes are divided into 5 classes based on their first digit.
- 1xx (Informational): Request received, continuing process.
- 2xx (Successful): The action was successfully received, understood, and accepted.
- 3xx (Redirection): Further action must be taken in order to complete the request.
- 4xx (Client Error): The request contains bad syntax or cannot be fulfilled.
- 5xx (Server Error): The server failed to fulfill an apparently valid request.
2. Success (2xx)
- 200 OK: The standard response for successful HTTP requests.
- 201 Created: The request has been fulfilled and resulted in a new resource being created.
- 204 No Content: The server successfully processed the request and is not returning any content.
3. Client Errors (4xx)
The most confusing pair is 401 vs 403.
- 400 Bad Request: The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax).
- 401 Unauthorized: "Unauthenticated". Requires login. (You don't have an ID card.)
- 403 Forbidden: "Unauthorized". You are logged in, but lack permission. (You have an ID card, but no access pass.)
- 404 Not Found: The requested resource could not be found.
4. Server Errors (5xx)
- 500 Internal Server Error: A generic error message, given when an unexpected condition was encountered.
- 502 Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server.
- 503 Service Unavailable: The server is currently unable to handle the request due to a temporary overload or maintenance.
Conclusion
HTTP Status Codes are the language of communication between client and server.
Returning the appropriate status code is fundamental to good API design and key to reducing debugging time. Don't just return
200 OKfor everything!
TechHTTPWebNetwork
Explore Related Tools
Try these free developer tools from Pockit
Add PDF Page Numbers
Organize your documents professionally. Add page numbers to PDFs locally—fast, private, and no uploads.
Try it
PDF Page Organizer
Reorder, delete, and rotate PDF pages visually with drag-and-drop. Reorganize multi-page documents instantly—no upload, 100% browser-based PDF editor.
Try it
CSS Grid Generator
Build CSS Grid layouts visually—no syntax to memorize. Set columns, rows, gaps, alignment, and sizing (1fr, auto, minmax). Preview your grid live and copy clean CSS.
Try it
HEX to RGB Converter
Get the right color format instantly. Convert between HEX, RGB, and HSL values with a single click.
Try it
CSS Flexbox
Master layouts without the headache. Experiment with Flexbox properties visually and generate clean code in seconds.
Try it
CSS Border Radius
Design unique shapes with ease. Visually tweak border-radius and copy the code instantly.
Try it