HTTP Status Code Reference
HTTPステータスコードの一覧と検索。カテゴリ別に分類、番号や名前でフィルタリングできます。
1xx Informational
The server has received the request headers; the client should proceed to send the request body.
The server is switching protocols as requested by the client via the Upgrade header.
2xx Success
The request has succeeded. The meaning depends on the HTTP method used.
The request has been fulfilled, resulting in the creation of a new resource.
The request has been accepted for processing, but the processing has not been completed.
The server successfully processed the request but is not returning any content.
3xx Redirection
The requested resource has been permanently moved to a new URL.
The requested resource temporarily resides under a different URL.
The resource has not been modified since the last request; use the cached version.
The request should be repeated with another URL, but future requests should still use the original URL.
The request and all future requests should be repeated using another URL, preserving the HTTP method.
4xx Client Error
The server cannot process the request due to a client error (e.g., malformed syntax).
Authentication is required and has failed or has not been provided.
The server understood the request but refuses to authorize it.
The requested resource could not be found on the server.
The request method is not supported for the requested resource.
The server timed out waiting for the request from the client.
The request could not be completed due to a conflict with the current state of the resource.
The requested resource is no longer available and will not be available again.
The request entity is larger than the server is willing or able to process.
The URI provided was too long for the server to process.
The media format of the requested data is not supported by the server.
The user has sent too many requests in a given amount of time (rate limiting).
5xx Server Error
The server has encountered a situation it does not know how to handle.
The request method is not supported by the server and cannot be handled.
The server received an invalid response from an upstream server.
The server is not ready to handle the request, often due to maintenance or overload.
The server did not receive a timely response from an upstream server.
How to Use the HTTP Status Code Reference
This HTTP status code reference provides a comprehensive list of all common HTTP response status codes, organized by category. Use the search filter at the top to quickly find any status code by its number or name. The tool displays all codes from 1xx informational responses through 5xx server errors, with a clear description of each code meaning and typical use case. All data is displayed client-side with no server calls needed.
Understanding HTTP Status Code Categories
HTTP status codes are divided into five categories. 1xx codes are informational responses indicating the request was received and processing continues. 2xx codes indicate successful processing, with 200 OK being the most common. 3xx codes handle redirections, telling the client to look elsewhere for the resource. 4xx codes represent client errors where the request contains bad syntax or cannot be fulfilled. 5xx codes indicate server errors where the server failed to fulfill an apparently valid request.
Common Status Codes for Web Developers
The most frequently encountered status codes in web development include 200 (OK) for successful requests, 301 and 302 for redirects, 404 for missing resources, and 500 for server errors. Understanding these codes is essential for debugging API integrations, configuring web servers, and building robust error handling in web applications. The 429 status code is increasingly important for rate-limited APIs, while 401 and 403 are critical for authentication and authorization flows.
HTTPステータスコードリファレンスについて
主要なHTTPステータスコードをカテゴリ別に一覧表示し、番号や名前で即座に検索できるリファレンスツールです。1xx情報レスポンスから5xxサーバーエラーまで網羅しており、各コードの意味と用途を確認できます。API開発やWeb開発のデバッグに便利です。
HTTPステータスコード一覧の使い方
検索フィルタにコード番号(例: 404)、名前の一部(例: Forbidden)、説明中のキーワード(例: cache)を入力すると、一覧が即座に絞り込まれます。カテゴリごとに色分けされているため、「4xxだからクライアント側の問題」「5xxだからサーバ側」という切り分けが視覚的に行えます。
1. API設計でのステータスコード選定
REST APIのレスポンス設計では、成功をすべて200で返すのではなく、リソース作成は201 Created、ボディ不要の成功は204 No Content、楽観ロックの競合は409 Conflictと使い分けると、クライアント実装が分岐しやすくなります。設計レビューの際に「この操作に最も適切なコードはどれか」を本ツールで確認できます。
2. 障害調査・アクセスログの解析
本番障害でアクセスログに502 / 503 / 504が並んだとき、意味の違い(上流から不正な応答 / 過負荷・メンテナンス中 / 上流の応答タイムアウト)を即座に確認することで、ロードバランサ側かアプリケーション側かの切り分けが速くなります。504が多発していればアプリの処理時間、502ならプロセスのクラッシュやポート設定をまず疑う、といった初動判断に使えます。
3. サイト移転・URL変更時のリダイレクト設計
ドメイン移転やURL構造変更では、301/308(恒久)と302/307(一時)の違いに加え、HTTPメソッドが保持されるか(307/308は保持、301/302はGETに変換され得る)が重要です。SEO評価の引き継ぎとフォームPOSTの挙動を、設定前に本ツールで再確認してください。
よくある落とし穴 / Common Pitfalls
ステータスコード自体はエラーを「出す」ものではありませんが、選び方・返し方を誤ると実害が出ます。現場で頻出する誤用をまとめました。
Status codes do not throw errors themselves, but choosing or returning the wrong one causes real-world problems. Here are the most common misuses.
| 落とし穴 / Pitfall | なぜ問題か / Why it hurts | 対処 / Fix |
|---|---|---|
| 401と403を混同する Confusing 401 with 403 | 401は「未認証」、403は「認証済みだが権限なし」。逆に返すとクライアントの再ログイン処理が誤作動する 401 means "not authenticated", 403 means "authenticated but not allowed". Swapping them breaks client re-login flows | 認証情報が無い/無効なら401(WWW-Authenticate必須)、権限不足なら403。詳細は401と403の違いガイドへReturn 401 (with WWW-Authenticate) for missing/invalid credentials, 403 for insufficient permission |
| 検証中のURLに301を使う Using 301 while still testing | 301はブラウザに強くキャッシュされ、設定を戻してもユーザー側に古い転送先が残り続ける Browsers cache 301 aggressively; even after you revert, users keep landing on the old target | 検証中は302/307を使い、確定後に301/308へ切り替える Use 302/307 during testing; switch to 301/308 only when final |
| POSTのリダイレクトに301/302を使う Redirecting POST with 301/302 | 歴史的経緯で多くのクライアントがGETに変換し、リクエストボディが消える Most clients historically rewrite the method to GET, dropping the request body | メソッドとボディを保持したい場合は307(一時)/308(恒久)を使う Use 307 (temporary) or 308 (permanent) to preserve the method and body |
| 204にレスポンスボディを付ける Returning a body with 204 | RFC 9110で204はボディ禁止。プロキシやクライアントがパースエラーや接続不整合を起こす RFC 9110 forbids a body with 204; proxies and clients may fail to parse or desync the connection | ボディを返すなら200を使う。204を返すならボディは完全に空にする Use 200 if you need a body; keep 204 responses strictly empty |
| 429でRetry-Afterを返さない 429 without Retry-After | クライアントが待ち時間を判断できず、即時リトライで過負荷がさらに悪化する Clients cannot tell how long to wait and retry immediately, making the overload worse | Retry-Afterヘッダ(秒数またはHTTP日付)を必ず付与し、クライアント側は指数バックオフと併用するAlways send Retry-After (seconds or HTTP-date); clients should combine it with exponential backoff |
| 恒久削除ページに404を返し続ける Returning 404 for permanently removed pages | 404は「理由不明で見つからない」。検索エンジンのクローラーは再訪を続ける 404 means "not found, reason unknown"; crawlers keep revisiting the URL | 二度と復活しないURLには410 Goneを返し、インデックス削除を早める Return 410 Gone for URLs that will never come back to speed up deindexing |
| すべての失敗を500で返す Mapping every failure to 500 | クライアント起因のエラーまで500だと監視アラートが鳴り続け、原因の切り分けができない If client-side errors also become 500, monitoring alerts fire constantly and triage becomes impossible | 入力不正は400、認証は401、権限は403、競合は409にマッピングし、500は未知の例外だけに限定する Map validation to 400, auth to 401, permission to 403, conflicts to 409; reserve 500 for unknown exceptions |
言語別コード例 / Code Examples by Language
ステータスコードの取得・分岐をコードで行う場合の最小サンプルです。
Minimal snippets to read and branch on HTTP status codes programmatically.
JavaScript (fetch)
const res = await fetch("/api/users");
console.log(res.status); // 200, 404, ...
console.log(res.ok); // 200-299 なら true / true for 200-299
if (res.status === 429) {
// 待機秒数 / seconds to wait
const wait = res.headers.get("Retry-After");
}Python (requests)
import requests
from http import HTTPStatus
r = requests.get("https://api.example.com/users")
print(r.status_code) # 200, 404, ...
print(HTTPStatus(r.status_code).phrase) # "OK", "Not Found"
r.raise_for_status() # 4xx/5xx で例外 / raises on 4xx/5xxGo (net/http)
resp, err := http.Get("https://api.example.com/users")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
fmt.Println(resp.StatusCode) // 200
fmt.Println(http.StatusText(resp.StatusCode)) // "OK"
if resp.StatusCode == http.StatusTooManyRequests {
// レート制限時の処理 / handle rate limiting
}Shell (curl)
# ステータスコードだけ取得 / Status code only
curl -s -o /dev/null -w "%{http_code}" https://example.com
# レスポンスヘッダを確認(リダイレクト追跡) / Inspect headers, follow redirects
curl -sIL https://example.comBefore / After 実例 / Request & Response Examples
例1: 301 恒久リダイレクト / Permanent redirect
GET /old-page HTTP/1.1
Host: example.com↓
HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page
Cache-Control: max-age=31536000Locationヘッダが移転先。Cache-Controlの期間だけブラウザが転送を記憶します。
The Location header carries the new URL; browsers remember the redirect for the Cache-Control lifetime.
例2: 401 と 403 のレスポンス比較 / 401 vs 403 responses
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="api"↓ 認証後も権限が足りない場合 / after authenticating, if still not allowed:
HTTP/1.1 403 Forbidden
Content-Type: application/json
{"error": "insufficient_scope"}例3: 429 レート制限 / Rate limiting with Retry-After
POST /api/search HTTP/1.1
Host: api.example.com↓
HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json
{"error": "rate_limited", "retry_after": 30}Why browser-only? / なぜブラウザ完結か
Status codes themselves are public knowledge, but the way you search for them is not. During an incident, the terms you type — an internal endpoint path, a vendor name, the exact code your gateway keeps returning — reveal what is breaking inside your infrastructure. A server-backed reference would receive and log every one of those queries. This page ships the entire status code table as static data inside the HTML, and the search filter runs in memory in your browser: no query ever leaves the tab, and there is no per-request latency or rate limit. You can verify this yourself by opening DevTools → Network and typing in the filter — no requests appear. Once the page has loaded, the reference even keeps working if your network goes down, which is exactly when you tend to need it.
ステータスコード自体は公開情報ですが、障害対応中に検索する語句(社内APIのパスやゲートウェイが返し続けるコードなど)は社内事情そのものです。本ツールはコード表をページ内に静的データとして持ち、絞り込みはブラウザのメモリ上で完結します。検索語が外部に送信されることはなく、DevTools → Networkタブで通信が発生しないことを確認できます。一度読み込めばオフラインでも参照できるため、ネットワーク障害時の調査にも使えます。
関連ガイド / Related Guides
関連ツール / Related Tools
開発をもっと効率的に
PR
レンタルサーバー
エックスサーバー
国内シェアNo.1の高速レンタルサーバー(エックスサーバー社調べ)。WordPressも簡単セットアップ。
詳しく見る →レンタルサーバー
ConoHa WING
国内最速クラスのレンタルサーバー。独自ドメイン永久無料特典付き(特典内容は変更される場合があります)。
詳しく見る →レンタルサーバー
mixhost
高速SSD・HTTP/3対応のクラウド型レンタルサーバー。
詳しく見る →VPS
シンVPS
メモリ単価国内最安・オールNVMe SSD搭載の高性能VPS。開発・検証環境の構築に。
詳しく見る →Windows VPS
ConoHa for Windows Server
Windows環境のVPS。リモートデスクトップで開発・検証環境を構築。
詳しく見る →