{
  "slug": "entity-tag",
  "term": "Entity tag",
  "aliases": [
    "ETag",
    "HTTP entity tag"
  ],
  "definition": "An entity tag is an opaque HTTP validator assigned by a server to a selected representation for cache validation and conditional requests.",
  "note": "An ETag identifies a representation within the server's validation rules; it is not a portable file digest, a deduplication key, or a monotonically increasing version counter. Preserve the returned value when sending a conditional request rather than deriving one from the object's bytes. In Amazon S3, ETags and explicitly named checksum fields serve different purposes.",
  "status": "shipping",
  "advantages": [
    {
      "text": "HTTP conditional requests can validate cached representations or reject a write when the supplied validator no longer matches the current representation.",
      "citationIds": [
        "c1"
      ]
    },
    {
      "text": "Amazon S3 PutObject and CompleteMultipartUpload accept an existing object's ETag through If-Match for a server-side write precondition.",
      "citationIds": [
        "c3"
      ]
    }
  ],
  "limitations": [
    {
      "text": "In S3 general-purpose buckets, an ETag can equal the object-data MD5 for supported single-part operations with plaintext or SSE-S3 encryption, but multipart upload and SSE-KMS or SSE-C do not provide that MD5 guarantee.",
      "citationIds": [
        "c2"
      ]
    },
    {
      "text": "S3 ETags reflect object contents, not metadata; matching ETags are not proof that no intervening write or metadata change occurred.",
      "citationIds": [
        "c2",
        "c4"
      ]
    },
    {
      "text": "HTTP If-Match requires strong comparison, so a weak validator such as W/\"example\" cannot establish a strong match.",
      "citationIds": [
        "c1"
      ]
    }
  ],
  "related": [
    "object-storage",
    "conditional-write",
    "multipart-upload"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-12",
  "citations": [
    {
      "id": "c1",
      "title": "RFC 9110: HTTP Semantics, entity tags and conditional requests",
      "url": "https://www.rfc-editor.org/rfc/rfc9110.html#section-8.8.3",
      "accessed": "2026-10-12"
    },
    {
      "id": "c2",
      "title": "Amazon S3 API Reference: Object, ETag semantics",
      "url": "https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html",
      "accessed": "2026-10-12"
    },
    {
      "id": "c3",
      "title": "Amazon S3: How to prevent object overwrites with conditional writes",
      "url": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-writes.html",
      "accessed": "2026-10-12"
    },
    {
      "id": "c4",
      "title": "Object ETags: checksums and conditional writes are different",
      "url": "https://hesela.com/analyses/object-etags-checksums-conditional-writes/",
      "accessed": "2026-10-12"
    }
  ]
}
