Skip to main content

What is the HTTP status code?

Glossary image
Status code HTTP response code

An HTTP status code is a numeric code that a server sends in response to a web request. These codes help inform the client (such as a web browser) about the result of the request, whether it was successful, resulted in an error, or required further action. Let us dive into what these codes mean, and why they are important.

Types of HTTP status codes

HTTP status codes are divided into five categories based on their first digit:

  1. 1xx - Informational: These codes mean that the request has been received and is being processed.
    • 100 Continue: The server has received the request and the client can continue sending the request.
  2. 2xx - Successful: The request was received, understood, and accepted.
    • 200 OK: The request was successful, and the server is sending the requested data.
  3. 3xx - Redirect: The client must take additional action to complete the request.
    • 301 Moved Permanently: The requested resource has been permanently moved to a new URL.
    • 302 Found: The resource has been temporarily moved to another URL.
  4. 4xx - Client error: The request contained an error or could not be fulfilled by the client.
    • 400 Bad Request: The server could not understand the request due to invalid syntax.
    • 404 Not Found: The requested resource could not be found on the server.
  5. 5xx - Server error: The server could not fulfill a valid request.
    • 500 Internal Server Error: A generic error message when the server encounters an unexpected condition.
    • 503 Service Unavailable: The server is temporarily unable to handle the request.

Why are HTTP status codes important?

HTTP status codes are essential for both users and webmasters:

  • For users: They show why a page might not load correctly. For example, a "404 Not Found" error page explains that the requested page does not exist.
  • For webmasters: They help diagnose and fix problems on the website. For example, a "500 Internal Server Error" may indicate a problem with the server's configuration or code.

How do you use HTTP status codes?

When you build or maintain a website, you should ensure that the correct status codes are returned in the right situations. This improves the user experience and helps search engines understand and index your content correctly.

Have a question?

Get in touch if you'd like to learn more about this topic.

Contact Us