Students & new developers
Build an HTTP status-code explorer
Explore the language of HTTP responses, then build this five-band explorer with one HTML file.
Select 404 to see what it means.
1xx Informational
2xx Success
3xx Redirection
4xx Client errors
5xx Server errors
Every recorded code stays in place while you search. These include historical and nonstandard entries.
| Code | Name | Class | Description |
|---|---|---|---|
| 100 | Continue | Informational | The client should continue with its request. |
| 101 | Switching Protocols | Informational | The server is switching protocols. |
| 102 | Processing | Informational | The server has received and is processing the request. |
| 103 | Early Hints | Informational | Return some response headers before final response. |
| 200 | OK | Success | The request succeeded. |
| 201 | Created | Success | The request succeeded and a resource was created. |
| 202 | Accepted | Success | The request has been accepted for processing. |
| 203 | Non-Authoritative Information | Success | Returned metadata is from a local or third-party copy. |
| 204 | No Content | Success | There is no content to send for this request. |
| 205 | Reset Content | Success | Tells the client to reset the document that sent this request. |
| 206 | Partial Content | Success | Used when the Range header is sent by the client. |
| 207 | Multi-Status | Success | Conveys information about multiple resources (WebDAV). |
| 208 | Already Reported | Success | Members already enumerated (WebDAV). |
| 226 | IM Used | Success | Result of instance-manipulations applied to the resource. |
| 300 | Multiple Choices | Redirection | The request has more than one possible response. |
| 301 | Moved Permanently | Redirection | The resource has moved permanently. |
| 302 | Found | Redirection | The resource has moved temporarily. |
| 303 | See Other | Redirection | Get the requested resource at another URI with a GET. |
| 304 | Not Modified | Redirection | The response has not been modified. |
| 305 | Use Proxy | Redirection | Deprecated. The resource had to be accessed through the proxy given in the Location header. |
| 306 | (Unused) | Redirection | No longer used. The code is reserved. |
| 307 | Temporary Redirect | Redirection | The resource is temporarily at a different URI; method unchanged. |
| 308 | Permanent Redirect | Redirection | The resource is permanently at a different URI; method unchanged. |
| 400 | Bad Request | Client Error | The server cannot process the request due to a client error. |
| 401 | Unauthorized | Client Error | Authentication is required and has failed or not been provided. |
| 402 | Payment Required | Client Error | Reserved for future use. |
| 403 | Forbidden | Client Error | The client does not have access rights to the content. |
| 404 | Not Found | Client Error | The server cannot find the requested resource. |
| 405 | Method Not Allowed | Client Error | The request method is not supported for the resource. |
| 406 | Not Acceptable | Client Error | No content matching the acceptance criteria was found. |
| 407 | Proxy Authentication Required | Client Error | Authentication with the proxy is required. |
| 408 | Request Timeout | Client Error | The server timed out waiting for the request. |
| 409 | Conflict | Client Error | The request conflicts with the current state of the server. |
| 410 | Gone | Client Error | The requested content has been permanently deleted. |
| 411 | Length Required | Client Error | The Content-Length header is required. |
| 412 | Precondition Failed | Client Error | Preconditions in the request headers were not met. |
| 413 | Content Too Large | Client Error | The request body is larger than limits. |
| 414 | URI Too Long | Client Error | The requested URI is longer than the server will interpret. |
| 415 | Unsupported Media Type | Client Error | The media format is not supported. |
| 416 | Range Not Satisfiable | Client Error | The requested range cannot be fulfilled. |
| 417 | Expectation Failed | Client Error | The Expect request header cannot be met. |
| 418 | I'm a teapot | Client Error | The server refuses to brew coffee with a teapot. |
| 421 | Misdirected Request | Client Error | The request reached a server that cannot produce a response for it. |
| 422 | Unprocessable Content | Client Error | The request was well formed but had semantic errors. |
| 423 | Locked | Client Error | The resource being accessed is locked (WebDAV). |
| 424 | Failed Dependency | Client Error | The request failed because a request it depended on failed (WebDAV). |
| 425 | Too Early | Client Error | The server is unwilling to risk processing a replayed request. |
| 426 | Upgrade Required | Client Error | The client should switch to a different protocol. |
| 428 | Precondition Required | Client Error | The origin server requires the request to be conditional. |
| 429 | Too Many Requests | Client Error | The user has sent too many requests in a given time. |
| 431 | Request Header Fields Too Large | Client Error | Header fields are too large. |
| 451 | Unavailable For Legal Reasons | Client Error | The resource is unavailable for legal reasons. |
| 500 | Internal Server Error | Server Error | The server encountered an unexpected condition. |
| 501 | Not Implemented | Server Error | The request method is not supported by the server. |
| 502 | Bad Gateway | Server Error | The server got an invalid response from an upstream server. |
| 503 | Service Unavailable | Server Error | The server is not ready to handle the request. |
| 504 | Gateway Timeout | Server Error | The upstream server did not respond in time. |
| 505 | HTTP Version Not Supported | Server Error | The HTTP version is not supported. |
| 506 | Variant Also Negotiates | Server Error | Internal configuration error in content negotiation. |
| 507 | Insufficient Storage | Server Error | The server cannot store the representation (WebDAV). |
| 508 | Loop Detected | Server Error | An infinite loop was detected (WebDAV). |
| 510 | Not Extended | Server Error | Further extensions are required to fulfill the request. |
| 511 | Network Authentication Required | Server Error | The client needs to authenticate to gain network access. |
Make it your own
Build your own version.
Save this file as http-explorer.html and open it in your browser. It fetches the complete free reference once, builds the five bands, and keeps searches local.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTTP status-code explorer</title>
<style>
body { max-width: 1000px; margin: 32px auto; padding: 16px; font: 16px system-ui; color: #243b50; }
input, button { font: inherit; padding: 12px; }
input { max-width: 100%; box-sizing: border-box; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; }
.tile { border: 1px solid #aebfcd; border-top: 3px solid #426b90; border-radius: 5px; background: #f3f7fa; text-align: left; cursor: pointer; }
.tile strong, .tile span { display: block; }
.tile strong { font-size: 1.4rem; margin-bottom: 8px; }
.tile span { font-size: .8rem; }
.dimmed { opacity: .35; }
.tile:hover, .tile:focus-visible { opacity: 1; background: #dce9f2; }
.detail { grid-column: 1 / -1; padding: 18px; border: 1px solid #7b95a9; background: #fff; }
.detail button { float: right; }
</style>
<h1>HTTP status-code explorer</h1>
<p>Select a tile to read its meaning. ● marks often encountered codes.</p>
<label>Find a code or phrase <input id="search" type="search"></label>
<p id="status" role="status">Loading codes…</p>
<button id="retry" hidden>Retry</button>
<main id="explorer"></main>
<script type="module">
const explorer = document.querySelector('#explorer');
const search = document.querySelector('#search');
const status = document.querySelector('#status');
const retry = document.querySelector('#retry');
const classes = ['Informational', 'Success', 'Redirection', 'Client errors', 'Server errors'];
const common = new Set([200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 429, 500, 502, 503]);
let records = [];
let tiles = [];
let selected;
const detail = document.createElement('section');
detail.className = 'detail';
detail.hidden = true;
// Data goes into textContent, never into HTML strings.
function select(tile, record) {
detail.remove();
selected = tile;
const close = document.createElement('button');
close.textContent = 'Close';
close.onclick = () => {
detail.remove();
tile.focus({ preventScroll: true });
};
const heading = document.createElement('h3');
heading.textContent = `${record.Code} · ${record.Name}`;
const text = document.createElement('p');
text.textContent = `${record.Category}. ${record.Description}`;
detail.replaceChildren(close, heading, text);
// Insert after the last tile on this row, including on phones.
const row = [...tile.parentElement.children].filter(item => item.offsetTop === tile.offsetTop);
row.at(-1).after(detail);
detail.hidden = false;
detail.scrollIntoView({ block: 'nearest' });
close.focus({ preventScroll: true });
}
function filter() {
const query = search.value.trim().toLowerCase();
let count = 0;
for (const { tile, record } of tiles) {
const match = [record.Code, record.Name, record.Description].join(' ').toLowerCase().includes(query);
tile.classList.toggle('dimmed', !match);
if (match) count++;
}
status.textContent = `${count} of ${records.length} codes${count ? '' : ' · No matches; try another phrase.'}`;
}
async function load() {
retry.hidden = true;
status.textContent = 'Loading codes…';
try {
const response = await fetch('https://mysafeinfo.com/api/data/httpstatuscodes?format=json');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
records = await response.json();
explorer.replaceChildren();
tiles = [];
for (let family = 1; family <= 5; family++) {
const band = document.createElement('section');
const heading = document.createElement('h2');
heading.textContent = `${family}xx · ${classes[family - 1]}`;
const grid = document.createElement('div');
grid.className = 'tiles';
for (const record of records.filter(row => Math.floor(row.Code / 100) === family).sort((a, b) => a.Code - b.Code)) {
const tile = document.createElement('button');
tile.className = 'tile';
const code = document.createElement('strong');
code.textContent = `${record.Code}${common.has(Number(record.Code)) ? ' ●' : ''}`;
const name = document.createElement('span');
name.textContent = record.Name;
tile.append(code, name);
tile.onclick = () => select(tile, record);
grid.append(tile);
tiles.push({ tile, record });
}
band.append(heading, grid);
explorer.append(band);
}
filter();
} catch {
status.textContent = 'Could not load the codes. Check your connection and try again.';
retry.hidden = false;
}
}
search.addEventListener('input', filter);
retry.addEventListener('click', load);
document.addEventListener('keydown', event => {
if (event.key === 'Escape') {
detail.remove();
selected?.focus({ preventScroll: true });
}
});
load();
</script>
</html>
A project brief you can finish
-
Milestone 1: show the complete list
Load the free JSON, sort Code numerically, and show the number, name, category and description. Keep the data separate from your rendering function.
-
Milestone 2: search and filter
Search the code, name and description together. Combine the search with a category selector, keep keyboard focus in the control, and announce the result count without moving the page.
-
Milestone 3: handle every state
Show loading, useful empty results and a clear error with Retry. Check response.ok before reading JSON. The starter shows a Retry button when its request fails; this page uses embedded records.
Stretch goals
Add a “copy code” action, keyboard shortcuts with visible instructions, or a favorites view held in memory. Test a search with no matches, an offline request, and a small phone. Do not assume every recorded code is a current standard: the dataset includes historical and nonstandard entries. Compare a code with the IANA registry (opens in a new tab) and the relevant specification.
Questions
Why check response.ok?
A completed HTTP request can still return an error status. Fetch does not reject merely because a server returned 404 or 500.
What should an empty search look like?
Say that nothing matched and suggest clearing the query or changing the category. Do not replace it with a network-error message.
Free in full. No Data Pass or API key needed. Opening this guide does not use your API allowance.
What each record contains
Explore the dataset and its sources. These fields are in the complete download.
| Field | How to read it |
|---|---|
Code |
HTTP status number. A listed code is not necessarily a current IANA standard. |
Name |
Short status label. |
Category |
Status family; useful for filters and grouping. |
Description |
Dataset explanation; check IANA and the linked standard for implementation details. |
Working with the download? Convert CSV to JSON, or turn a column into a list with the comma separator.
For your next project
More subjects to build with.
HTTP status codes are free in full. The Data Pass covers the rest of the catalog.
The Data Pass includes complete downloads and API access across the catalog.
Data Pass
$69one payment / 365 days
Explore the Data PassNo account required. No automatic renewal.