# HTTP 412 Precondition Failed

> HTTP 412 means a condition in your request headers, such as If-Match, was false on the server. See why it happens, how to retry, and how developers handle it.

Canonical: https://scaplet.com/errors/http/412

Guide Error · HTTP status codes

HTTP 412 means a condition in your request headers, such as If-Match, was false on the server. See why it happens, how to retry, and how developers handle it.

4 min

read

4

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

412 4xx · Client error

The short answer

HTTP 412 Precondition Failed means one or more conditions in the request headers, such as If-Match, If-Unmodified-Since or If-None-Match, evaluated to false on the server, so the server did not apply the method. It usually signals a stale copy or a lost-update guard. Fetch the current version and ETag, merge, then retry.

1. [What does HTTP 412 mean?](#what-does-http-412-mean)
2. [Which headers cause it](#which-headers-cause-it)
3. [What to do when you see it](#what-to-do-when-you-see-it)
4. [How developers use and handle 412](#how-developers-use-and-handle-412)
5. [What it does to SEO](#what-it-does-to-seo)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F412%20(%22HTTP%20412%20Precondition%20Failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F412%20(%22HTTP%20412%20Precondition%20Failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F412%20(%22HTTP%20412%20Precondition%20Failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F412%20(%22HTTP%20412%20Precondition%20Failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_Explained

## What does HTTP 412 mean?

RFC 9110 says the 412 (Precondition Failed) [status code](/glossary/http-status-codes) indicates that one or more conditions given in the request header fields evaluated to false when tested on the server. The client can place preconditions on the current resource state and so prevent the method from being applied if the target resource is in an unexpected state.

It is the server saying: you asked me to act only if the resource still looks a certain way, and it no longer does. MDN describes it for [conditional requests](/glossary/etag) on methods other than GET or HEAD when the condition defined by headers such as `If-Unmodified-Since` or `If-Match` is not met. That makes it a deliberate safeguard, not a malfunction.

_02_Conditional headers that can lead to a 412

## Which headers cause it

Header

### `If-Match`

Condition

The resource's current ETag matches one in the list (or `*` and it exists)

When it fails

The ETag differs, so someone changed the resource

Header

### `If-Unmodified-Since`

Condition

The resource has not changed since the given date

When it fails

It was modified after that date

Header

### `If-None-Match`

Condition

No current representation matches the listed ETag

When it fails

For methods other than GET and HEAD, a match returns 412 (GET and HEAD get a 304)

Header

### `If-Match: *`

Condition

A current representation exists

When it fails

The resource does not exist

RFC 9110 says `If-Match` is most often used with state-changing methods (POST, PUT, DELETE) to prevent accidental overwrites when several clients may act on the same resource, which it calls the lost update problem. RFC 9110 also fixes the order of evaluation: when `If-Match` is present it is checked first, and a false result means a 412 unless the server can tell the change was already applied. A server must ignore `If-Unmodified-Since` when the request also has `If-Match`.

The RFC allows an alternative: if the state-changing request appears to have already been applied, a server may respond with a 2xx code instead. A client that lost a response and retries might therefore get a success rather than a 412.

_03_How it works

## What to do when you see it

MDN describes the usual case as an upload or a modification of a resource, so a visitor sees a 412 on an editing or upload screen rather than on a normal page. The fix is to reload and try again. Cloudflare says it may serve this response in connection with ETag headers.

1. 1

### Reload and redo the change

Your edit was based on an out-of-date copy. Reloading fetches the current version and its ETag.
2. 2

### Check what changed

If another person or process updated the resource, merge their change with yours.
3. 3

### Resend with the new validator

Send the update again with the new `If-Match` value, or the new date for `If-Unmodified-Since`.
4. 4

### If it fails every time, inspect the request

Make sure the client is sending the ETag it just received, byte for byte, quotes included. A rewritten or weak ETag will not match under strong comparison.

_04_Checklist

## How developers use and handle 412

MDN's example is a wiki edit. The server returns an `ETag` for the page. When the user saves, the client sends it back in `If-Match`. If the hashes do not match, the document was edited in between, and the server returns a 412.

1. 01 Servers: use a strong ETag, since RFC 9110 requires strong comparison for `If-Match`.
2. 02 Clients: treat 412 as a normal outcome. Refetch, re-apply the user's change on top of the new version, and retry.
3. 03 Return a body that shows the current version so the client can merge without another round trip.
4. 04 Need a less strict signal for the same situation? A [409](/errors/http/409) tells the user the request conflicts with the current state, without relying on validators.

Optimistic concurrency with If-Match

```
GET /pages/42 HTTP/1.1 HTTP/1.1 200 OK ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4" PUT /pages/42 HTTP/1.1 If-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4" HTTP/1.1 412 Precondition Failed
```

_05_Explained

## What it does to SEO

Crawlers fetch pages with plain GET requests that carry no write preconditions, so a 412 on a public page is unusual and points to a misconfigured rule. Google handles it like other 4xx codes except 429: the content isn't used, and indexed URLs that return it are removed from the index. See [4xx errors](/seo-issues/4xx-errors).

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What is HTTP 412?

It is the Precondition Failed status code. A condition in the request headers, such as If-Match or If-Unmodified-Since, evaluated to false on the server, so the server refused to apply the method.

_02_ How do I fix a 412 Precondition Failed error?

Reload to get the current version and its ETag, merge your change, and resend with the new If-Match value. If it always fails, check that the client sends back the exact ETag it received.

_03_ What is the difference between 412 and 409?

A 412 is triggered by a precondition header that evaluated to false. A 409 says the request conflicts with the current state of the resource, whether or not validators were used.

_04_ Does a 412 mean my data was lost?

No. The server did not apply your request because the resource was not in the state you expected. Nothing was overwritten, which is the point of the precondition.

Sources · 4

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- mozilla.org
- cloudflare.com
- google.com

1. 01 [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html) rfc-editor.org · checked 2026-10-25
2. 02 [412 Precondition Failed - HTTP - MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412) developer.mozilla.org · checked 2026-10-25
3. 03 [Error 412: Precondition Failed - Cloudflare Support docs](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/4xx-client-error/error-412/) developers.cloudflare.com · checked 2026-10-25
4. 04 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

## Keep learning

[All errors](/errors)

[Learn HTTP 409 Conflict HTTP status codes](/errors/http/409) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next HTTP 400 Bad Request HTTP status codes](/errors/http/400) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in errors
[411 Length Required](/errors/http/411) [413 Request Entity Too Large](/errors/http/413) [413 Request Entity Too Large in Apache](/errors/http/413/apache)

More in HTTP status codes
[HTTP 301 Moved Permanently](/errors/http/301) [HTTP 302 Found](/errors/http/302) [HTTP 303 See Other](/errors/http/303) [HTTP 304 Not Modified](/errors/http/304) [HTTP 307 Temporary Redirect](/errors/http/307) [HTTP 308 Permanent Redirect](/errors/http/308) [HTTP 400 Bad Request](/errors/http/400) [HTTP 401 Unauthorized](/errors/http/401) [HTTP 405 Method Not Allowed](/errors/http/405) [HTTP 407 Proxy Authentication Required](/errors/http/407) [HTTP 408 Request Timeout](/errors/http/408) [HTTP 409 Conflict](/errors/http/409) [HTTP 412 Precondition Failed](/errors/http/412) [HTTP 431 Request Header Fields Too Large](/errors/http/431) [HTTP 499 Client Closed Request](/errors/http/499) [HTTP 500 Internal Server Error](/errors/http/500) [HTTP 501 Not Implemented](/errors/http/501) [HTTP redirect codes](/errors/http/http-redirect-codes) [HTTP status code list](/errors/http/http-status-code-list) [REST API status codes](/errors/http/rest-api-status-codes) [100 Continue](/errors/http/100) [101 Switching Protocols](/errors/http/101) [402 Payment Required](/errors/http/402) [403 Forbidden](/errors/http/403)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [ETag](/glossary/etag)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
