Free auditStart free
GuideError · HTTP status codes

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.

4 min
read
4
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
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?
  2. Which headers cause it
  3. What to do when you see it
  4. How developers use and handle 412
  5. 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 withChatGPTClaudePerplexityGoogleAI Mode
01Explained

What does HTTP 412 mean?

RFC 9110 says the 412 (Precondition Failed) status code 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 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.

03How 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.

04Checklist

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. 01Servers: use a strong ETag, since RFC 9110 requires strong comparison for If-Match.
  2. 02Clients: treat 412 as a normal outcome. Refetch, re-apply the user's change on top of the new version, and retry.
  3. 03Return a body that shows the current version so the client can merge without another round trip.
  4. 04Need a less strict signal for the same situation? A 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
05Explained

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.

Questions

Asked a lot.

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

01What 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.

02How 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.

03What 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.

04Does 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. 01RFC 9110: HTTP Semanticsrfc-editor.org · checked 2026-10-25
  2. 02412 Precondition Failed - HTTP - MDN Web Docsdeveloper.mozilla.org · checked 2026-10-25
  3. 03Error 412: Precondition Failed - Cloudflare Support docsdevelopers.cloudflare.com · checked 2026-10-25
  4. 04How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-10-25
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane