Back to Dev Tools

HTTP Status Code Reference

Complete reference guide for HTTP status codes with descriptions, use cases, and examples. Perfect for API development, debugging, and web development.

100

Continue

informational

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

💡 Common Examples:

  • Large file uploads
  • Expect: 100-continue header

🎯 When to Use:

Rarely used in modern web development

101

Switching Protocols

informational

The requester has asked the server to switch protocols and the server has agreed to do so.

💡 Common Examples:

  • WebSocket upgrade
  • HTTP/2 upgrade

🎯 When to Use:

Protocol negotiations

102

Processing

informational

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

💡 Common Examples:

  • WebDAV operations
  • Long-running requests

🎯 When to Use:

Extended operations

200

OK

success

The request has succeeded. The meaning of the success depends on the HTTP method.

💡 Common Examples:

  • GET request successful
  • POST request processed

🎯 When to Use:

Most common success response

201

Created

success

The request has been fulfilled, resulting in the creation of a new resource.

💡 Common Examples:

  • User registration
  • File upload
  • Database record creation

🎯 When to Use:

REST API resource creation

202

Accepted

success

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

💡 Common Examples:

  • Async job queuing
  • Email sending
  • Background processing

🎯 When to Use:

Asynchronous operations

204

No Content

success

The server successfully processed the request and is not returning any content.

💡 Common Examples:

  • DELETE operations
  • PUT updates
  • Configuration changes

🎯 When to Use:

Successful operations with no response body

206

Partial Content

success

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

💡 Common Examples:

  • Video streaming
  • Large file downloads
  • Resume downloads

🎯 When to Use:

Range requests and streaming

301

Moved Permanently

redirection

The URL of the requested resource has been changed permanently.

💡 Common Examples:

  • Domain changes
  • URL restructuring
  • HTTPS migration

🎯 When to Use:

Permanent redirects for SEO

302

Found

redirection

The URL of the requested resource has been changed temporarily.

💡 Common Examples:

  • Temporary maintenance
  • A/B testing
  • Load balancing

🎯 When to Use:

Temporary redirects

304

Not Modified

redirection

Indicates that the resource has not been modified since the version specified by the request headers.

💡 Common Examples:

  • Browser caching
  • API caching
  • CDN optimization

🎯 When to Use:

Caching and performance optimization

307

Temporary Redirect

redirection

The server sends this response to direct the client to get the requested resource at another URI with same method.

💡 Common Examples:

  • Method-preserving redirects
  • POST form redirects

🎯 When to Use:

Method-preserving temporary redirects

308

Permanent Redirect

redirection

The resource is now permanently located at another URI, specified by the Location header.

💡 Common Examples:

  • API versioning
  • Permanent URL changes

🎯 When to Use:

Method-preserving permanent redirects

400

Bad Request

client error

The server could not understand the request due to invalid syntax.

💡 Common Examples:

  • Invalid JSON
  • Missing required fields
  • Malformed requests

🎯 When to Use:

General client-side errors

401

Unauthorized

client error

The client must authenticate itself to get the requested response.

💡 Common Examples:

  • Missing API key
  • Invalid credentials
  • Expired tokens

🎯 When to Use:

Authentication required

403

Forbidden

client error

The client does not have access rights to the content.

💡 Common Examples:

  • Insufficient permissions
  • IP blocking
  • Resource access denied

🎯 When to Use:

Authorization failures

404

Not Found

client error

The server can not find the requested resource.

💡 Common Examples:

  • Missing pages
  • Deleted resources
  • Wrong URLs

🎯 When to Use:

Resource not found

405

Method Not Allowed

client error

The request method is known by the server but is not supported by the target resource.

💡 Common Examples:

  • POST to read-only resource
  • DELETE not allowed

🎯 When to Use:

HTTP method restrictions

409

Conflict

client error

The request conflicts with the current state of the server.

💡 Common Examples:

  • Duplicate email
  • Version conflicts
  • Resource already exists

🎯 When to Use:

State conflicts

410

Gone

client error

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

💡 Common Examples:

  • Deleted content
  • Discontinued services

🎯 When to Use:

Permanently removed resources

422

Unprocessable Entity

client error

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

💡 Common Examples:

  • Validation errors
  • Business rule violations

🎯 When to Use:

Validation failures

429

Too Many Requests

client error

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

💡 Common Examples:

  • API rate limiting
  • DDoS protection
  • Spam prevention

🎯 When to Use:

Rate limiting

500

Internal Server Error

server error

The server has encountered a situation it does not know how to handle.

💡 Common Examples:

  • Application crashes
  • Database errors
  • Unhandled exceptions

🎯 When to Use:

General server errors

501

Not Implemented

server error

The request method is not supported by the server and cannot be handled.

💡 Common Examples:

  • Unsupported HTTP methods
  • Missing features

🎯 When to Use:

Unimplemented functionality

502

Bad Gateway

server error

The server, while working as a gateway to get a response needed to handle the request, got an invalid response.

💡 Common Examples:

  • Proxy errors
  • Upstream server issues
  • Load balancer problems

🎯 When to Use:

Gateway and proxy errors

503

Service Unavailable

server error

The server is not ready to handle the request.

💡 Common Examples:

  • Maintenance mode
  • Server overload
  • Temporary outages

🎯 When to Use:

Temporary unavailability

504

Gateway Timeout

server error

The server is acting as a gateway and cannot get a response in time.

💡 Common Examples:

  • Slow upstream servers
  • Network timeouts
  • Database timeouts

🎯 When to Use:

Timeout errors

Quick Reference Guide

🎯 Most Common Codes

  • 200: OK - Success
  • 201: Created - Resource created
  • 400: Bad Request - Client error
  • 401: Unauthorized - Auth required
  • 404: Not Found - Missing resource
  • 500: Internal Server Error

🔧 API Development

  • POST Success: 201 Created
  • PUT Success: 200 OK or 204 No Content
  • DELETE Success: 204 No Content
  • Validation Error: 422 Unprocessable Entity
  • Rate Limiting: 429 Too Many Requests

🌐 Web Development

  • Permanent Redirect: 301 Moved Permanently
  • Temporary Redirect: 302 Found
  • Caching: 304 Not Modified
  • Access Denied: 403 Forbidden
  • Server Down: 503 Service Unavailable

Best Practices

✅ Do's

  • • Use appropriate status codes for different scenarios
  • • Provide meaningful error messages in response body
  • • Be consistent across your API endpoints
  • • Use 2xx codes for successful operations
  • • Use 4xx codes for client errors
  • • Use 5xx codes for server errors

❌ Don'ts

  • • Don't use 200 OK for all responses
  • • Don't use 404 for authorization issues
  • • Don't expose sensitive error details
  • • Don't use non-standard status codes unnecessarily
  • • Don't ignore the semantic meaning of codes
  • • Don't mix up client and server error codes