{
  "schema_version": 2,
  "id": "commands/zrevrange",
  "title": "ZREVRANGE",
  "url": "https://redis.io/docs/latest/commands/zrevrange/",
  "summary": "Returns members in a sorted set within a range of indexes in reverse order.",
  "since": "1.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:43+01:00",
  "page_type": "content",
  "content_hash": "505d7cac04d18687ea71658a4a43713d2218c152ec58b6ffbccac410bfde5320",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the specified range of elements in the sorted set stored at `key`.\nThe elements are considered to be ordered from the highest to the lowest score.\nDescending lexicographical order is used for elements with equal score.\n\nApart from the reversed ordering, `ZREVRANGE` is similar to [`ZRANGE`](https://redis.io/docs/latest/commands/zrange)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the sorted set.\n\n</details>\n\n<details open><summary><code>start</code></summary>\n\nThe start index, zero-based. Negative values count from the end of the sorted set (`-1` is the member with the highest score).\n\n</details>\n\n<details open><summary><code>stop</code></summary>\n\nThe stop index, zero-based and inclusive. Negative values count from the end of the sorted set.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>WITHSCORES</code></summary>\n\nAlso return the score of each member.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> ZADD myzset 1 \"one\"\n(integer) 1\nredis> ZADD myzset 2 \"two\"\n(integer) 1\nredis> ZADD myzset 3 \"three\"\n(integer) 1\nredis> ZREVRANGE myzset 0 -1\n1) \"three\"\n2) \"two\"\n3) \"one\"\nredis> ZREVRANGE myzset 2 3\n1) \"one\"\nredis> ZREVRANGE myzset -2 -1\n1) \"two\"\n2) \"one\""
    },
    {
      "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> | Deprecated as of Redis v6.2.0. |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n* [Array reply](../../develop/reference/protocol-spec#arrays): a list of members in the specified range, optionally with their scores if _WITHSCORE_ was used.\n\n**RESP3:**\n\n* [Array reply](../../develop/reference/protocol-spec#arrays): a list of members in the specified range, optionally with their scores if _WITHSCORE_ was used."
    }
  ],
  "examples": []
}
