What 200 means
The request succeeded. 200 is defined in RFC 9110 §15.3.1, and what the body contains depends on the method:
- GET: the requested resource.
- HEAD: the same headers a GET would get, with no body.
- POST: the result of the action, such as a confirmation or the processed data.
- PUT, DELETE: a description of the outcome (if there's nothing to say, 204 fits better).
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 5120
Cache-Control: max-age=300
ETag: "a1b2c3"
<!doctype html>...
200 is cacheable by default: without Cache-Control or Expires, a browser or CDN may still keep it for a heuristic period, usually based on Last-Modified. Send explicit caching headers so you decide how long copies live.
When 200 is the wrong answer
The status line is what clients, caches and crawlers act on, not the words on the page. A 200 that wraps a failure misleads all of them:
- Error pages served with 200. A "Page not found" template, an empty search result or an "out of stock, item removed" page that answers 200 is a soft 404.
- APIs that always return 200 with
{"error": "..."}in the body. Monitoring, retries and caches see success and keep the bad result. - Single-page apps whose server answers 200 with
index.htmlfor every path, including paths that don't exist. - Maintenance pages with 200. Search engines may index the maintenance text in place of your content.
- A newly created resource where 201 Created with a
Locationheader says more.
How to fix it
- Return 404 Not Found or 410 Gone for content that doesn't exist, while still showing your friendly error page as the body.
- Use real error codes in APIs: 400 or 422 for bad input, 401 or 403 for auth, 500 or 503 for server trouble.
- For a SPA, have the server know its routes and send 404 for unknown ones, or add
<meta name="robots" content="noindex">from JavaScript on the not-found view. - Use 204 No Content when a successful request has nothing to return.
200 and SEO
Google only considers pages that answer 2xx for indexing, but a 200 is not a guarantee. When the content of a 200 page looks like an error, or there's almost no content, Google may classify it as a soft 404 and report it under "Soft 404" in Search Console's Page indexing report; the URL isn't indexed. Redirecting removed pages to the home page is treated the same way. A 200 is also what makes noindex, rel=canonical and structured data count: Google reads them only from pages it can fetch successfully.
Related codes
- 204 No Content: success with no body.
- 304 Not Modified: the cached 200 is still valid.
- 404 Not Found: what a missing page should answer instead of a soft 404.
To see the exact status a URL returns, including every redirect on the way, use the Redirect Checker, or send any method and headers with the HTTP Request Builder.