{
  "schema_version": 2,
  "id": "commands/bitconvert",
  "title": "BITCONVERT",
  "url": "https://redis.io/docs/latest/commands/bitconvert/",
  "summary": "Converts a string bitmap to the native bitmap representation.",
  "since": "8.12.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-23T06:19:08-08:00",
  "page_type": "content",
  "content_hash": "21bf1b72977ccea31b48e8f99d71c8a00c73afcec83e276a65d7680c5fe43103",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "`BITCONVERT` is an internal command that preserves string-to-native bitmap\nconversions during replication and append-only file (AOF) replay. Applications\ncannot call it directly."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe key to convert to a native bitmap.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": "Redis uses this command to replay a representation change independently of the\nreceiving node's `bitmap-default-roaring` setting. Ordinary clients receive an\nunknown-command error and do not see it in `COMMAND INFO` or `COMMAND DOCS`.\n\nConverting a string preserves its bits, logical byte length, and expiration.\nA missing key becomes an empty native bitmap. An existing native bitmap is\nunchanged. Other value types return `WRONGTYPE`; strings beyond the supported\nnative bitmap length return an error."
    },
    {
      "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=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`SETBIT`](https://redis.io/docs/latest/commands/setbit) | [`BITROAROP`](https://redis.io/docs/latest/commands/bitroarop)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Roaring-compressed bitmaps](https://redis.io/docs/latest/develop/data-types/strings/bitmaps#roaring-compressed-bitmaps)"
    }
  ],
  "examples": []
}
