HTTP Status Code Comparisons
Side-by-side comparisons of HTTP status codes — semantics, caching behavior, SEO implications, and API impact. Use these to make the right choice for redirects, error handling, and response design.
How to Use These Comparisons
Status code confusion is one of the most common sources of bugs in HTTP APIs and web server configuration. Many codes are close neighbors — 301 and 302 both redirect, but one permanently moves a URL while the other is temporary. 401 and 403 both block access, but for entirely different reasons with different fix paths. 400 and 422 both reject request bodies, but at different stages of validation.
Each comparison page in this section explains: the exact semantic difference between two codes, which headers are required for each, how browsers and HTTP clients behave differently when they receive each code, how search engine crawlers treat each code for indexing and ranking, whether the response is cacheable, and which code to use in specific real-world scenarios.
Start with the pair that matches your implementation decision. The most common starting points are the redirect comparisons (when building URL migration or maintenance redirect infrastructure), the 4xx comparisons (when designing error responses for a REST API), and the 5xx comparisons (when debugging production incidents and understanding which layer of the stack is failing).
3xx Redirect Comparisons
The redirect codes split along two axes: permanence and method preservation. Choosing wrong costs SEO equity or breaks API clients that depend on HTTP method semantics.
4xx Client Error Comparisons
The 4xx range is where most API design decisions live. Authentication vs authorization, validation vs conflict, rate limiting vs unavailability — these comparisons cover the common decision points.
- 400 vs 403
- 400 vs 404
- 400 vs 409
- 400 vs 422 — Bad Request vs Unprocessable
- 400 vs 431
- 401 vs 403 — Unauthenticated vs Forbidden
- 401 vs 404
- 401 vs 407
- 403 vs 404 — Hidden vs Missing
- 403 vs 405
- 404 vs 410 — Not Found vs Gone
- 404 vs 451
- 405 vs 501
- 406 vs 415
- 408 vs 504
- 409 vs 412
- 409 vs 422
- 411 vs 413
- 412 vs 428 — Failed vs Required
- 413 vs 414
- 413 vs 431
- 415 vs 422
- 421 vs 503
- 422 vs 424
- 425 vs 429
- 426 vs 505
- 428 vs 412
- 429 vs 503 — Rate Limited vs Unavailable
- 451 vs 403
- 511 vs 401
5xx Server Error Comparisons
The 5xx codes identify where in the stack an error occurred. Distinguishing 500 from 502 from 504 is critical for incident response — each points to a different component and a different remediation path.
2xx Success Comparisons
1xx Informational Comparisons
FAQ
How should I use these HTTP comparison guides?
Start with the pair that matches your implementation decision, then confirm cache, SEO, and API implications before shipping. Each page covers the exact semantic difference, required headers, browser and crawler behavior, and practical code examples.
Are these pages only for SEO decisions?
No. They are built for server routing, API design, observability, and client behavior decisions. The redirect comparisons matter most for SEO; the 4xx comparisons matter most for API design; the 5xx comparisons matter most for incident response.