← Back to Developer Tools
📡

HTTP Error Codes — 4xx Client Errors & 5xx Server Errors

All 34 status codes · Search · Filter · Snippets · cURL Tester · Favorites

💡

Complete reference for HTTP error codes. 4xx codes indicate client errors — the request was wrong. 5xx codes indicate server errors — the server failed. Includes code snippets for handling errors in JavaScript, Express.js, Python Flask, and nginx. Use the filter tab to see only 4xx or 5xx codes.

1xx4
2xx5
3xx5
4xx13
5xx7
🌐 Live Status Checker
CORS-safe — works for public APIs and your own endpoints
100
Continue
Server received request headers, client should proceed
Upload
101
Switching Protocols
Server is switching to the protocol specified in Upgrade header
WebSocket
102
Processing
Server has received and is processing the request (WebDAV)
REST
103
Early Hints
Server sends preliminary hints for browser to preload resources
Cache
200
OK
Request succeeded — standard success response
RESTSuccess📦 Cacheable
201
Created
Request succeeded and a new resource was created
RESTSuccess
202
Accepted
Request accepted but processing not yet complete
REST
204
No Content
Request succeeded but no response body
RESTSuccess
206
Partial Content
Server is delivering only part of the resource (range request)
UploadCache📦 Cacheable
301
Moved Permanently
Resource permanently moved to new URL — use Location header
RedirectCache📦 Cacheable
302
Found
Resource temporarily at different URL — method may change
Redirect
304
Not Modified
Resource not changed since last request — use cached version
Cache📦 Cacheable
307
Temporary Redirect
Temporary redirect — HTTP method preserved
Redirect
308
Permanent Redirect
Permanent redirect — HTTP method preserved
RedirectCache📦 Cacheable
400
Bad Request
Server cannot process request due to client error
RESTError
401
Unauthorized
Client must authenticate to get the requested response
AuthError↺ Retryable
403
Forbidden
Client is authenticated but not authorized for this resource
AuthError
404
Not Found
Server cannot find the requested resource
RESTError📦 Cacheable
405
Method Not Allowed
HTTP method not allowed for this resource
RESTError
408
Request Timeout
Server timed out waiting for the request
Error↺ Retryable
409
Conflict
Request conflicts with current state of the server
RESTError↺ Retryable
410
Gone
Resource permanently deleted — unlike 404, this is intentional
RESTErrorCache📦 Cacheable
411
Length Required
Server requires Content-Length header
UploadError
413
Content Too Large
Request body exceeds server size limit
UploadError
415
Unsupported Media Type
Server rejects request due to unsupported Content-Type
RESTError
422
Unprocessable Content
Request is well-formed but has semantic errors (validation failed)
RESTError
429
Too Many Requests
Client has sent too many requests (rate limited)
AuthErrorREST↺ Retryable
500
Internal Server Error
Server encountered unexpected error
Error↺ Retryable
501
Not Implemented
Server does not support the functionality required
Error📦 Cacheable
502
Bad Gateway
Upstream server returned invalid response
Error↺ Retryable
503
Service Unavailable
Server temporarily unavailable — overloaded or down for maintenance
Error↺ Retryable
504
Gateway Timeout
Upstream server did not respond in time
Error↺ Retryable
507
Insufficient Storage
Server unable to store the representation (WebDAV)
UploadError↺ Retryable
511
Network Authentication Required
Client needs to authenticate to gain network access (captive portal)
AuthError↺ Retryable
📡

Click any status code to see full details, code snippets, and usage guide

NavigateEsc CloseCtrl+F Search
Ctrl+F Focus search Navigate codesEsc Close detailCtrl+L Clear filters

Frequently Asked Questions

What is the most common HTTP error code?

404 Not Found is the most famous HTTP error code, seen by virtually every internet user. In APIs, 400 Bad Request and 401 Unauthorized are the most common errors developers encounter. 500 Internal Server Error is the most feared — it means something unexpected went wrong on the server.

Should my API return 500 for database errors?

Yes — when an unexpected database error occurs that you cannot specifically categorize, 500 is appropriate. However, for known error conditions (database unique constraint violation = 409 Conflict, record not found = 404), use the specific code. Never expose raw database error messages in production API responses — log them server-side and return a generic message.

What is 429 Too Many Requests and how do I implement it?

429 is returned when a client exceeds your rate limit. Implement with a rate limiter middleware (express-rate-limit for Node.js, flask-limiter for Python). Include Retry-After: 60 header to tell clients when to retry. Add X-RateLimit-Limit: 100 (max requests), X-RateLimit-Remaining: 0 (remaining), X-RateLimit-Reset: 1699999999 (reset timestamp) headers.

When should I return 410 Gone vs 404 Not Found?

410 Gone explicitly tells the client (and search crawlers) that the resource existed and was permanently deleted. 404 is ambiguous — it may mean the resource never existed, was deleted, or the URL is wrong. Use 410 for intentionally deleted content to help search engines remove it from their index. Googlebot treats 410 as a stronger signal to deindex the URL than 404.

What does nginx error 502 Bad Gateway mean?

502 means nginx (acting as reverse proxy) received an invalid or empty response from the upstream server (your app). Common causes: app crashed and restart hasn't completed, app is taking too long to start, wrong proxy_pass port in nginx config, app is listening on wrong network interface (use 0.0.0.0 not 127.0.0.1 in Docker).

What is the difference between 503 and 504?

503 Service Unavailable means the server cannot handle the request right now — it's overloaded or down for maintenance. The server itself is responding (it sent the 503). 504 Gateway Timeout means the proxy/gateway made a request to an upstream server and it did not respond within the timeout period. 503 = server can't handle it now. 504 = upstream did not respond in time.

You might also like

Related Tools