Devlopr

Understanding HTTP Status Codes with Examples

Siddharth Patel
Siddharth Patel
Full-stack developer
Published on July 28, 2025

Every time you visit a website, your browser sends a request to a server. That server responds with an HTTP status code. You may not always see them, but they're always there behind the scenes — helping your browser understand whether the request succeeded, failed, or needs more information.

If you’re building web apps, APIs, or working with servers, understanding HTTP status codes is essential. This guide breaks them down into categories and gives real examples to help you remember what each one means.

What Are HTTP Status Codes?

HTTP status codes are 3-digit numbers returned by a server in response to an HTTP request. They’re divided into five classes, each beginning with a different number:

Category Range Meaning
1xx 100–199 Informational
2xx 200–299 Success
3xx 300–399 Redirection
4xx 400–499 Client Errors
5xx 500–599 Server Errors

1xx – Informational Responses

These are rare in frontend development and mostly used in protocol-level communication.

100 Continue

The server has received the request headers, and the client can proceed with the body. Used in complex requests like file uploads.

101 Switching Protocols

The server agrees to switch to a different protocol, like WebSocket.

2xx – Success Codes

These indicate that the request was received, understood, and accepted.

200 OK

The standard success response. This means the request worked exactly as expected.

GET /products → 200 OK

201 Created

Used when a new resource has been successfully created.

POST /users → 201 Created

204 No Content

The request succeeded, but there’s nothing to return. Often used when deleting a resource.

DELETE /comments/123 → 204 No Content

3xx – Redirection Codes

These tell the client to make another request to a different location.

301 Moved Permanently

The resource has been moved to a new URL. Browsers will cache this redirect.

GET /old-page → 301 → /new-page

302 Found

Temporarily redirected. The client should use the original URL again next time.

304 Not Modified

The client’s cached version is still valid. No need to download again.

GET /style.css → 304 Not Modified

4xx – Client Error Codes

These mean something went wrong with the request from the user’s side.

400 Bad Request

The request was malformed, missing parameters, or had invalid syntax.

POST /users with missing "email" → 400 Bad Request

401 Unauthorized

Authentication is required but missing or invalid.

GET /dashboard without token → 401 Unauthorized

403 Forbidden

You’re authenticated but don’t have permission to access the resource.

GET /admin-panel as regular user → 403 Forbidden

404 Not Found

The requested resource could not be found.

GET /products/9999 → 404 Not Found

405 Method Not Allowed

The request method is not supported for the endpoint.

PUT /login → 405 Method Not Allowed

429 Too Many Requests

You’ve hit a rate limit. The server is telling you to slow down.

5xx – Server Error Codes

These mean the server failed to handle a valid request.

500 Internal Server Error

Something went wrong on the server — usually a bug or crash.

GET /products → 500 Internal Server Error

502 Bad Gateway

A server acting as a gateway or proxy received an invalid response from the upstream server.

503 Service Unavailable

The server is currently down for maintenance or overloaded.

504 Gateway Timeout

The upstream server took too long to respond.

How to See HTTP Status Codes

You can see status codes in several ways:

  • Browser Dev Tools: Open the Network tab, reload the page, and inspect the status of each request.
  • Postman: Run any request and look for the status code above the response.
  • curl: Use the terminal to make a request and get the response code.
curl -I https://example.com

This returns only the response headers, including the status code.

Status Code Quick Reference

Status Meaning Common Use
200 OK Successful GET or POST
201 Created New user, resource created
204 No Content Delete action completed
301 Moved Permanently Redirect old route to new one
400 Bad Request Missing or invalid input
401 Unauthorized Missing token or auth failure
403 Forbidden Not allowed to access
404 Not Found URL does not exist
500 Internal Server Error Bug on the backend

Once you get familiar with these codes, you'll find them incredibly helpful while debugging your apps, handling API responses, or setting up error messages for users.

Back to Home
HomeExplore