← all status codes

HTTP 412 Precondition Failed

What a 412 Precondition Failed response means, why it happens, and the fastest ways to fix it.

412
Precondition Failed
4xx client error
Class

A conditional header (If-Match, If-Unmodified-Since) evaluated false — the server refused to apply the change to avoid clobbering someone else's write.

  • Optimistic concurrency: another writer changed the resource first (ETag mismatch).
  • Re-fetch the resource, get the fresh ETag, reapply your change on top.

Notes

HTTP status codes are defined in RFC 9110 (which replaced RFC 7231). The first digit is the class: 1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error.

Same class: 400 · 401 · 403 · 404 · 405 · 408 · 409 · 410 · 413 · 415 · 418 · 422 · 425 · 429 · 431 · 451

All codes: HTTP status code reference

Frequently asked questions

What does HTTP 412 mean?

HTTP 412 Precondition Failed: A conditional header (If-Match, If-Unmodified-Since) evaluated false — the server refused to apply the change to avoid clobbering someone else's write.

How do I fix a 412 error?

Re-fetch the resource, get the fresh ETag, reapply your change on top.

Is a 412 my fault or the server's?

412 is a client error — the request itself needs to change, though server misconfiguration can also trigger it.

Found this useful? 113 free, browser-only tools by Yuvrajsinh Jadav — an engineer who ships production AI systems. No account, nothing sent anywhere.