HTTP Status Phrase to Code Lookup

Enter an HTTP reason phrase to find its numeric status code.

How it is calculated

This is a reverse lookup: you type an HTTP reason phrase and the tool returns the numeric status code and its class. The phrase is trimmed and lower-cased, so capitalisation and spaces around it do not matter, then matched against a fixed table of about 60 registered phrases. The class is ⌊code ÷ 100⌋ followed by xx, for example 5xx. There is no calculation or fuzzy matching: the whole phrase must match exactly, including spaces and hyphens (Multi-Status works, Multi Status does not). A number, an unknown phrase, or empty input gives no result. Older names such as Payload Too Large (413) are recognised; the newer wording Content Too Large is not.

Worked example

You see "Bad Gateway" in a log line and want the code. The tool lower-cases and trims it to "bad gateway", finds it in the table, and returns code 502. The class is ⌊502 ÷ 100⌋ = 5, shown as 5xx. A 5xx class means the failure is on the server side (here, a gateway or proxy got a bad answer from an upstream server), not a mistake in the request. Typing " BAD GATEWAY " gives the same result.

Try this example →

Common mistakes

  • Typing the number (404) and expecting the phrase. This tool only goes from phrase to code and returns nothing for digits.
  • Using an alternative spelling that is not in the table, such as "Request Entity Too Large", "Request-URI Too Long" or "Gateway Time-out". Use the registered wording, for example "Payload Too Large" or "URI Too Long".
  • Dropping a hyphen or adding punctuation. "Multi Status" and "Not Found." both find nothing, while "Multi-Status" and "Not Found" work.
  • Typing the newer wording "Content Too Large" or "Unprocessable Content". The tool knows the older names, "Payload Too Large" (413) and "Unprocessable Entity" (422).
  • Using a curly apostrophe in "I’m a teapot". Use a plain apostrophe (I'm a teapot) or leave it out (im a teapot); both give 418.

About this calculator

Every HTTP status code defined in RFC 9110 (and its predecessors RFC 7231 and RFC 2616) pairs a three-digit numeric code with a standard reason phrase — “200 OK”, “404 Not Found”, “502 Bad Gateway” — and this tool performs the reverse lookup: type the phrase (capitalisation doesn't matter), get the code and its class, shown as the hundred it belongs to — 1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error. It covers the standard registered phrases, including less common ones like “418 I'm a Teapot” and “429 Too Many Requests”, but it recognises the older names “Payload Too Large” (413) and “Unprocessable Entity” (422), not the newer RFC 9110 wording “Content Too Large” and “Unprocessable Content”.

Backend developers, API designers and DevOps engineers reach for this when reading a log line or error message that only shows the phrase, when writing API documentation, or when deciding which code class to return from a new endpoint — knowing that a phrase falls in the 400s immediately signals a client-side problem rather than a server fault, which changes how monitoring and alerting should treat it.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Matching is exact against a fixed list of older names, so some phrases you meet in newer documentation return nothing. Examples that come back empty are Moved Temporarily, Unprocessable Content and Request-URI Too Long, while Unprocessable Entity and URI Too Long work. The first digit still tells you whether to look at the client or the server. If a phrase from your logs returns nothing, tell us which one.

Popular calculators

All Calculators