HTTP Status Code Lookup - Complete Reference

Complete and searchable reference of HTTP status codes. Understand the meaning of each code (200, 404, 500, etc.) and when to use them in your APIs and web applications.

HTTP Status Code Lookup

All
1xx Informational
2xx Success
3xx Redirection
4xx Client Error
5xx Server Error

32 codes found

100
Continue

The server has received the request headers and the client should proceed to send the request body.

101
Switching Protocols

The server is switching protocols as requested by the client.

102
Processing

The server has received and is processing the request, but no response is available yet.

200
OK

The request was successful. The meaning depends on the HTTP method used.

201
Created

The request was successful and a new resource was created as a result.

202
Accepted

The request was accepted for processing, but the processing has not been completed.

204
No Content

The request was successful, but there is no content to send in the response.

206
Partial Content

The server is delivering only part of the resource due to a range header sent by the client.

301
Moved Permanently

The requested resource has been permanently moved to a new URL.

302
Found

The requested resource is temporarily located at a different URL.

304
Not Modified

The resource has not been modified since the last request. The client can use the cached version.

307
Temporary Redirect

Temporary redirect, keeping the original HTTP method.

308
Permanent Redirect

Permanent redirect, keeping the original HTTP method.

400
Bad Request

The server cannot process the request due to a client error (invalid syntax, for example).

401
Unauthorized

The request requires user authentication.

403
Forbidden

The server understood the request, but refuses to authorize it.

404
Not Found

The server could not find the requested resource.

405
Method Not Allowed

The HTTP method used is not allowed for this resource.

408
Request Timeout

The server timed out waiting for the request.

409
Conflict

The request could not be completed due to a conflict with the current state of the resource.

410
Gone

The requested resource is no longer available and will not be available again.

413
Payload Too Large

The request is larger than the server is willing or able to process.

414
URI Too Long

The provided URI was too long for the server to process.

415
Unsupported Media Type

The media format of the requested data is not supported by the server.

422
Unprocessable Entity

The request was well-formed but could not be followed due to semantic errors.

429
Too Many Requests

The user has sent too many requests in a given amount of time.

500
Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

501
Not Implemented

The server does not recognize the request method or lacks the ability to fulfill the request.

502
Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server.

503
Service Unavailable

The server is not ready to handle the request, usually due to maintenance or overload.

504
Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.

505
HTTP Version Not Supported

The HTTP version used in the request is not supported by the server.

📚 About HTTP Status Codes
  • 1xx (Informational): The request was received, process continues
  • 2xx (Success): The request was received, understood, and accepted successfully
  • 3xx (Redirection): Further action must be taken 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

What are HTTP Status Codes?

HTTP status codes are standardized responses that web servers send to clients to indicate the result of a request. They are divided into five categories, each indicated by the first digit of the three-digit code.

HTTP Code Categories

1xx - Informational

The request was received and the process continues. Rarely seen by end users. Generally used in HTTP/2 and WebSocket connections.

Examples: 100 Continue, 101 Switching Protocols

2xx - Success

The request was received, understood, and accepted successfully. Indicates that the action was performed as expected.

Examples: 200 OK, 201 Created, 204 No Content

3xx - Redirection

Additional action must be taken to complete the request. The resource has been moved or is temporarily available at another location.

Examples: 301 Moved Permanently, 302 Found, 304 Not Modified

4xx - Client Error

The request contains incorrect syntax or cannot be fulfilled. The error is on the client side (browser, app, etc.).

Examples: 400 Bad Request, 401 Unauthorized, 404 Not Found

5xx - Server Error

The server failed to fulfill an apparently valid request. The error is on the server side.

Examples: 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable

Most Common Codes

✅ Success

  • 200 OK: Everything is fine, standard response
  • 201 Created: Resource created successfully
  • 204 No Content: Success, but no content

🔄 Redirection

  • 301: Moved permanently
  • 302: Found (temporary)
  • 304: Not modified (cache)

❌ Client Error

  • 400: Invalid request
  • 401: Not authenticated
  • 403: Forbidden/no permission
  • 404: Not found

💥 Server Error

  • 500: Internal server error
  • 502: Bad Gateway
  • 503: Service unavailable

When to Use Each Code in REST APIs

GET (Fetch resources)

  • 200 OK: Resource found and returned
  • 404 Not Found: Resource does not exist
  • 304 Not Modified: Use cache (with ETag)

POST (Create resources)

  • 201 Created: Resource created successfully
  • 400 Bad Request: Invalid data
  • 409 Conflict: Conflict (e.g., email already exists)

PUT/PATCH (Update resources)

  • 200 OK: Updated and returns the resource
  • 204 No Content: Updated without returning data
  • 404 Not Found: Resource does not exist

DELETE (Remove resources)

  • 204 No Content: Removed successfully
  • 200 OK: Removed and returns information
  • 404 Not Found: Resource does not exist

Important Differences

401 vs 403

  • 401 Unauthorized: "Who are you? Please log in." (missing authentication)
  • 403 Forbidden: "I know who you are, but you don't have permission." (no authorization)

301 vs 302

  • 301 Moved Permanently: The resource moved forever. Update your links. SEO transfers ranking.
  • 302 Found: Temporary redirect. Keep the original link. SEO doesn't transfer ranking.

500 vs 502 vs 503

  • 500 Internal Server Error: Generic server error (bug in code, unhandled exception)
  • 502 Bad Gateway: Intermediary server received invalid response (proxy/load balancer)
  • 503 Service Unavailable: Server temporarily unavailable (maintenance, overload)

Best Practices for APIs

Well-Structured Error Response Example

{
  "status": 400,
  "error": "Bad Request",
  "message": "Invalid email",
  "details": {
    "field": "email",
    "value": "usuario@",
    "issue": "Invalid email format"
  },
  "timestamp": "2024-01-17T10:30:00Z",
  "path": "/api/users"
}

Less Known But Useful Codes

202 Accepted

Request accepted but still being processed (useful for asynchronous processing, jobs)

206 Partial Content

Part of the resource returned (used in resumable uploads, video streaming)

410 Gone

Resource existed but was permanently removed (better than 404 for deleted resources)

422 Unprocessable Entity

Well-formed request but with semantic errors (business validation failed)

429 Too Many Requests

Rate limit exceeded (include Retry-After header indicating when to try again)

451 Unavailable For Legal Reasons

Content blocked for legal reasons (censorship, DMCA, etc.)

Testing HTTP Codes

Using curl:

# See only the status code
curl -I -s -o /dev/null -w "%{http_code}" https://exemplo.com

# See complete headers
curl -I https://exemplo.com

# Make POST and see response
curl -X POST https://api.exemplo.com/users -d '{"name":"João"}' -H "Content-Type: application/json" -v

Using JavaScript (fetch):

fetch('https://api.exemplo.com/users')
  .then(response => {
    console.log('Status:', response.status);
    console.log('Status Text:', response.statusText);
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    return response.json();
  })
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Frequently Asked Questions

Why do I receive 304 instead of 200?

304 Not Modified means the resource hasn't changed since the last request. The browser is using the cached version. This is good for performance! Want to force 200? Do a hard refresh (Ctrl+Shift+R) or disable cache in DevTools.

Can I create my own HTTP codes?

Technically yes, but DON'T DO IT. Use the standardized codes. If none fits perfectly, use the closest one and add details in the response body. Custom codes break caches, proxies, and frameworks.

What to do when I constantly see 502/503?

502 usually indicates a problem with proxy/load balancer or backend server. 503 indicates overload or maintenance. If you are the developer, check server logs. If you are a user, wait a few minutes or contact support.