{
  "schema_version": 2,
  "id": "commands/decrby",
  "title": "DECRBY",
  "url": "https://redis.io/docs/latest/commands/decrby/",
  "summary": "Decrements a number from the integer value of a key. 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": "d610b9822dcdd022e9dff40cca7bd9c51a504a56b388ebfa80b83534631653f5",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `DECRBY` command reduces the value stored at the specified `key` by the specified `decrement`.\nIf the key does not exist, it is initialized with a value of `0` before performing the operation.\nIf the key's value is not of the correct type or cannot be represented as an integer, an error is returned.\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>\n\n<details open><summary><code>decrement</code></summary>\n\nThe integer amount to subtract from the value.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET mykey \"10\"\nOK\nredis> DECRBY mykey 3\n(integer) 7"
    },
    {
      "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": []
}
