# HTTP Status Code

> A number with three digits in each reply. It says how the request went.

**Field:** Infrastructure  
**Category:** Networking  
**Also known as:** Status Code, Response Code, 404, 500

## Think of it like

Think of it like a traffic light for a web page. One quick sign tells you if it went well.

## Definition

An HTTP status code is a three-digit number at the start of each response. It says how the request went. The first digit gives the group. 2xx means it worked, 3xx means look somewhere else, 4xx means the request was wrong and 5xx means the server failed. The best known are 200 OK, 301 Moved Permanently, 404 Not Found and 500 Internal Server Error. Browsers, apps and search engines all act on these numbers.

## Example

Jack deletes an old page. Visitors now get 404 Not Found, so Jack sets a 301 that sends them to the new page.

## Example code

```http
HTTP/1.1 404 Not Found
```

The page asked for does not exist on this server.

## Why it matters

The code tells you at a glance whose fault an error is: the request or the server.

## Common mistake

Using 302 when a page has moved for good. Search engines keep the old address. Use 301 instead.

## Three principles

- **Three digits.** The first gives the group.
- **4xx versus 5xx.** Your request or the server.
- **Machines act on it.** Browsers and search engines.

## Related terms

- [HTTP Response](https://learn.benibix.com/term/infrastructure/http-response)
- [HyperText Transfer Protocol (HTTP)](https://learn.benibix.com/term/infrastructure/http)
- [HTTP Request](https://learn.benibix.com/term/infrastructure/http-request)
- [HyperText Transfer Protocol Secure (HTTPS)](https://learn.benibix.com/term/infrastructure/https)
- [API Error Response](https://learn.benibix.com/term/development/error-response)

## Taught in

- [Fetch API and JSON](https://learn.benibix.com/learn/development-web/fetch-api-and-json): HTML, CSS and JS, 13/14
- [HTTP Status Codes](https://learn.benibix.com/learn/infrastructure-networking/http-status-codes): Computer Networking, 11/13

---

Source: https://learn.benibix.com/term/infrastructure/http-status-code
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
