<label>Status code: <input id="code" type="number" value="429" min="100" max="599"></label>
<p id="result"></p>
<script>
const codes = {
100: ["Continue","The server got the request headers and the client may send the body."],
101: ["Switching Protocols","The server agrees to change protocols."],
102: ["Processing","Still working on a long request (WebDAV)."],
103: ["Early Hints","Preliminary headers sent before the final response."],
200: ["OK","The request succeeded."],
201: ["Created","A new resource was created."],
202: ["Accepted","The request was accepted but not finished yet."],
203: ["Non-Authoritative Information","The content was modified by a proxy."],
204: ["No Content","Success, with no body."],
205: ["Reset Content","Success; the client should reset the form or view."],
206: ["Partial Content","Only the requested byte range is sent."],
207: ["Multi-Status","Several status codes for several resources (WebDAV)."],
208: ["Already Reported","Members already listed earlier in a WebDAV response."],
226: ["IM Used","The response is the result of instance manipulations (delta encoding)."],
300: ["Multiple Choices","Several representations are available."],
301: ["Moved Permanently","The resource has a new permanent URL."],
302: ["Found","The resource is temporarily at another URL."],
303: ["See Other","Fetch another URL with GET."],
304: ["Not Modified","The cached copy is still valid; no body is sent."],
305: ["Use Proxy","Deprecated; browsers ignore it."],
306: ["(Unused)","Reserved; no longer used."],
307: ["Temporary Redirect","Temporarily at another URL; repeat the same method and body."],
308: ["Permanent Redirect","Permanently at another URL; repeat the same method and body."],
400: ["Bad Request","The server cannot process a malformed request."],
401: ["Unauthorized","Authentication is required or failed."],
402: ["Payment Required","Reserved for future use."],
403: ["Forbidden","The server understood but refuses to allow it."],
404: ["Not Found","No resource at this URL."],
405: ["Method Not Allowed","The URL exists but not for this method."],
406: ["Not Acceptable","No representation matches the Accept headers."],
407: ["Proxy Authentication Required","Like 401, but for a proxy."],
408: ["Request Timeout","The client took too long to send the request."],
409: ["Conflict","The request conflicts with the current state."],
410: ["Gone","The resource was removed on purpose and will not return."],
411: ["Length Required","A Content-Length header is required."],
412: ["Precondition Failed","An If-โฆ condition was false."],
413: ["Content Too Large","The request body is too big."],
414: ["URI Too Long","The URL is longer than the server accepts."],
415: ["Unsupported Media Type","The body format is not supported."],
416: ["Range Not Satisfiable","The requested byte range is outside the file."],
417: ["Expectation Failed","The Expect header cannot be met."],
418: ["(Unused)","Reserved because of the \"I'm a teapot\" April Fools' joke (RFC 2324)."],
421: ["Misdirected Request","This server cannot answer for that host."],
422: ["Unprocessable Content","The syntax is fine but the data is invalid."],
423: ["Locked","The resource is locked (WebDAV)."],
424: ["Failed Dependency","Failed because an earlier request failed (WebDAV)."],
425: ["Too Early","The server will not process a request that might be replayed."],
426: ["Upgrade Required","The client must switch to another protocol."],
428: ["Precondition Required","The request must be conditional."],
429: ["Too Many Requests","The client hit a rate limit."],
431: ["Request Header Fields Too Large","Headers are too big."],
451: ["Unavailable For Legal Reasons","Blocked for legal reasons."],
500: ["Internal Server Error","A generic error on the server."],
501: ["Not Implemented","The server does not support this method at all."],
502: ["Bad Gateway","A proxy got an invalid response from the upstream server."],
503: ["Service Unavailable","The server is temporarily unable to respond."],
504: ["Gateway Timeout","A proxy did not get an answer in time."],
505: ["HTTP Version Not Supported","The HTTP version is not supported."],
506: ["Variant Also Negotiates","Content negotiation is misconfigured."],
507: ["Insufficient Storage","The server cannot store what is needed (WebDAV)."],
508: ["Loop Detected","An infinite loop was found (WebDAV)."],
510: ["Not Extended","Obsolete (the extension framework was retired)."],
511: ["Network Authentication Required","You must log in to the network first."]
};
const classes = { 1: 'Informational', 2: 'Success', 3: 'Redirection', 4: 'Client error', 5: 'Server error' };
const input = document.querySelector('#code');
function show() {
const code = Number(input.value);
const result = document.querySelector('#result');
const group = classes[Math.floor(code / 100)];
if (!group || code > 599) {
result.textContent = 'Not a valid status code (use 100โ599).';
return;
}
const [name, meaning] = codes[code] || ['(not a registered code)', 'Treat it like ' + Math.floor(code / 100) + '00.'];
result.innerHTML = '<strong></strong><br><span></span><br><small></small>';
result.querySelector('strong').textContent = code + ' ' + name;
result.querySelector('span').textContent = meaning;
result.querySelector('small').textContent = group + ' ยท response.ok would be ' + (code >= 200 && code < 300);
}
input.addEventListener('input', show);
show();
</script>
<style>
body { font-family: system-ui, sans-serif; }
strong { font-size: 1.4rem; }
</style>