{
  "schema_version": 2,
  "id": "commands/decr",
  "title": "DECR",
  "url": "https://redis.io/docs/latest/commands/decr/",
  "summary": "Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:12+01:00",
  "page_type": "content",
  "content_hash": "a6a163a9f42f6daa3208abcb06846c0fe02fc103bbb0599242339c7485e6703c",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Decrements the number stored at `key` by one.\nIf the key does not exist, it is set to `0` before performing the operation.\nAn error is returned if the key contains a value of the wrong type or contains a\nstring that can not be represented as integer.\nThis operation is limited to 64-bit signed integers.\n\nSee [`INCR`](https://redis.io/docs/latest/commands/incr) for extra information on increment/decrement operations."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET mykey \"10\"\nOK\nredis> DECR mykey\n(integer) 9\nredis> SET mykey \"234293482390480948029348230948\"\nOK\nredis> DECR mykey\n(error) value is not an integer or out of range"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the value of the key after decrementing it.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the value of the key after decrementing it."
    }
  ],
  "examples": []
}
