HTTP Status Codes: Complete Reference Guide

· 10 min read

What Are HTTP Status Codes?

HTTP status codes are three-digit numbers returned by a server in response to a client's request. They indicate whether the request was successful, redirected, or resulted in an error. Every time your browser loads a page, calls an API, or submits a form, the server responds with a status code.

Status codes are grouped into five categories based on their first digit:

🛠️ Quick reference tool

HTTP Status Codes Lookup → SSL Certificate Checker →

1xx Informational

These codes indicate that the server has received the request and is continuing to process it:

2xx Success

These are the codes you want to see. They mean everything worked:

# Check status codes with cURL
curl -I https://run-dev.com
# HTTP/2 200
# content-type: text/html; charset=UTF-8

curl -I https://run-dev.com/nonexistent
# HTTP/2 404

3xx Redirection

These codes tell the client to take additional action, usually following a different URL:

Understanding redirects is critical for SEO. Use 301 for permanent moves and 302/307 for temporary ones. Check your site's redirects with our DNS Lookup tool.

4xx Client Errors

These indicate the client sent a bad request:

5xx Server Errors

These indicate the server failed to fulfill a valid request:

Troubleshooting Common Errors

Debugging 400 Bad Request

# Check if your JSON is valid
curl -X POST https://api.example.com/data \
  -H "Content-Type: application/json" \
  -d '{"name": "test"}' \
  -v  # Verbose output shows request/response headers

# Common causes:
# - Invalid JSON syntax (use a JSON Formatter to validate)
# - Missing required fields
# - Wrong Content-Type header
# - URL-encoded data sent as JSON

Debugging 401/403

# Check your authentication
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://api.example.com/protected -v

# Common causes:
# - Expired token (decode with JWT Decoder)
# - Wrong API key
# - Missing Authorization header
# - Token doesn't have required scopes/permissions

Decode your JWT token with our JWT Decoder to check expiration and claims.

Debugging 500/502/503

# Check if the server is reachable
curl -I https://your-server.com

# Check DNS resolution
nslookup your-server.com

# Check SSL certificate
# Use our SSL Checker tool for a comprehensive check

# Monitor the endpoint
watch -n 5 'curl -s -o /dev/null -w "%{http_code}" https://your-server.com'

Frequently Asked Questions

What's the difference between 401 and 403?

401 Unauthorized means the request lacks valid authentication credentials — you need to log in or provide a token. 403 Forbidden means you're authenticated but don't have permission to access the resource. Re-authenticating won't help with 403.

When should I use 200 vs 201 vs 204?

Use 200 for successful GET/PUT/PATCH requests. Use 201 for successful POST requests that create a new resource. Use 204 for successful DELETE requests or updates where no response body is needed.

What does a 301 redirect mean for SEO?

A 301 (Moved Permanently) redirect tells search engines that a page has permanently moved. Search engines transfer most of the SEO value from the old URL to the new one. Always use 301 for permanent URL changes.

How do I fix a 502 Bad Gateway error?

A 502 means the server acting as gateway got an invalid response from the upstream server. Check if your backend application is running, verify the proxy configuration (Nginx, Apache), check server resource usage (CPU, memory, disk), and review application logs for crashes.

Related Tools

HTTP Status Codes SSL Checker DNS Lookup IP Lookup URL Encoder