TToolbox
🚦

HTTP Status Codes

Look up what each status code means

About this tool

HTTP Status Codes (standardized by IETF RFC 7231 and IANA) are 3-digit numeric signals returned by web servers indicating the outcome of a client's HTTP request. Categorized by their first digit (1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error), status codes are foundational to API debugging, network ops, and SEO crawling diagnostics. This tool provides instant lookup, semantic breakdowns, and actionable troubleshooting guides.

How to Use This Tool (Step-by-Step)

1

Search Status Code or Keyword

Type a 3-digit status number (e.g., 404, 502) or status phrase ('Forbidden', 'Gateway Timeout') into the quick filter bar.

2

Filter by Category Class

Click category tabs (1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error) to browse grouped codes.

3

Inspect Semantics & Troubleshooting

Review official RFC specifications, common trigger causes, browser caching implications, and practical fixes for each code.

Complete IANA & RFC Coverage

Exhaustive coverage of official RFC status codes—from classic 200 OK to 418 I'm a teapot and modern WebDAV extensions.

Actionable Production Fix Guides

Provides actionable troubleshooting checklists for notorious production bugs: 401 vs 403 auth, Nginx 502 Bad Gateway, and 504 Timeouts.

SEO Crawling & Ranking Impacts

Highlights critical SEO crawl-budget differences: 301 vs 302 link equity transfer, and 404 vs 410 permanent resource removal.

Production Troubleshooting & SEO Best Practices

  • •401 vs 403 core difference: 401 means unauthenticated ('Log in first'); 403 means authenticated but unauthorized ('I know who you are, but you lack permissions').
  • •Use 301 (Permanent) for SEO domain migrations: 301 transfers link equity and PageRank to the new URL. Using 302 (Temporary) preserves ranking on the old defunct path.
  • •Nginx 502 Bad Gateway root causes: 502 means Nginx reverse proxy cannot connect to upstream backends (Node.js, PHP-FPM). Usually caused by crashed app processes or port mismatches.

Code & Transformation Examples

High-Frequency Status Codes Cheat Sheet

Code & Short Meaning
• 200 OK                  : 请求成功,正常返回数据
• 301 Moved Permanently   : 永久重定向,搜索引擎传递页面权重
• 400 Bad Request         : 客户端请求参数校验失败
• 401 Unauthorized        : 未携带鉴权凭据或凭据失效
• 403 Forbidden           : 已登录但无访问该资源权限
• 404 Not Found           : 服务器找不到请求的资源
• 500 Internal Error      : 后端程序发生未捕获异常崩溃
• 502 Bad Gateway         : Nginx 网关无法连接到后端应用
• 504 Gateway Timeout     : 后端应用处理超时未响应网关
5 Status Class Definitions
• 1xx : 协议中间状态,提示客户端继续
• 2xx : 请求已被成功接收、理解并处理
• 3xx : 需要客户端采取进一步动作(跳转重定向)
• 4xx : 客户端引发的错误(入参、权限、地址错误)
• 5xx : 服务端引发的错误(崩溃、超时、网关断开)

* Distinguishing 4xx from 5xx is the golden rule for triaging frontend vs backend blame.

JavaScript Fetch Status Handling Boilerplate

Fetch Interceptor
async function request(url, options) {
  const response = await fetch(url, options);
  if (response.ok) {
    return await response.json(); // 状态码 200-299 视为成功
  }
  if (response.status === 401) {
    redirectToLogin(); // 401 自动跳转登录页
  } else if (response.status === 403) {
    alert("您暂无访问该模块的权限");
  } else if (response.status >= 500) {
    alert("服务器内部繁忙,请稍后再试");
  }
  throw new Error("HTTP Error: " + response.status);
}
Important Nuance
注意:fetch() 只要成功收到服务器响应(即便是 404 或 500),Promise 也不会 reject!必须通过 response.ok 或 response.status 手动检查。

* window.fetch only rejects on network failure or offline, never on HTTP 4xx/5xx status codes.

Frequently Asked Questions

Q: Why shouldn't a 'Not Found' page return HTTP 200 (Soft 404)?

A: Returning HTTP 200 with an 'Oops, not found' body is a 'Soft 404'. Google still indexes it, diluting crawl budget and risking thin-content penalties.

Q: Is HTTP 304 Not Modified an error?

A: Not an error at all. 304 is the heart of HTTP conditional caching. It informs the browser that cached assets are still fresh, skipping body transfer to load instantly.

Q: What is the origin of HTTP 418 I'm a teapot?

A: 418 was defined in RFC 2324 as an April Fools' joke for the Hyper Text Coffee Pot Control Protocol (HTCPCP). It remains a beloved Internet culture easter egg worldwide.

Related Tools

All processing happens locally in your browser. Your data is never uploaded to a server.
/