{
  "schema_version": 2,
  "id": "commands/incrbyfloat",
  "title": "INCRBYFLOAT",
  "url": "https://redis.io/docs/latest/commands/incrbyfloat/",
  "summary": "Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist.",
  "since": "2.6.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": "281c4580a337d31a90da063d30d4dbe4eec15616c1f26821baad386df005ed56",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Increment the string representing a floating point number stored at `key` by the\nspecified `increment`. By using a negative `increment` value, the result is\nthat the value stored at the key is decremented (by the obvious properties\nof addition).\nIf the key does not exist, it is set to `0` before performing the operation.\nAn error is returned if one of the following conditions occur:\n\n* The key contains a value of the wrong type (not a string).\n* The current key content or the specified increment are not parsable as a\n  double precision floating point number.\n\nIf the command is successful the new incremented value is stored as the new\nvalue of the key (replacing the old one), and returned to the caller as a\nstring.\n\nBoth the value already contained in the string key and the increment argument\ncan be optionally provided in exponential notation, however the value computed\nafter the increment is stored consistently in the same format, that is, an\ninteger number followed (if needed) by a dot, and a variable number of digits\nrepresenting the decimal part of the number.\nTrailing zeroes are always removed.\n\nThe precision of the output is fixed at 17 digits after the decimal point\nregardless of the actual internal precision of the computation."
    },
    {
      "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>increment</code></summary>\n\nThe floating-point amount to add to the value. A negative value decrements the value instead.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET mykey 10.50\nOK\nredis> INCRBYFLOAT mykey 0.1\n\"10.6\"\nredis> INCRBYFLOAT mykey -5\n\"5.6\"\nredis> SET mykey 5.0e3\nOK\nredis> INCRBYFLOAT mykey 2.0e2\n\"5200\""
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "implementation",
      "title": "Implementation",
      "role": "content",
      "text": "The command is always propagated in the replication link and the Append Only\nFile as a [`SET`](https://redis.io/docs/latest/commands/set) operation, so that differences in the underlying floating point\nmath implementation will not be sources of inconsistency."
    },
    {
      "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[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the value of the key after the increment.\n\n**RESP3:**\n\n[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the value of the key after the increment."
    }
  ],
  "examples": []
}
