{
  "schema_version": 2,
  "id": "commands/geohash",
  "title": "GEOHASH",
  "url": "https://redis.io/docs/latest/commands/geohash/",
  "summary": "Returns members from a geospatial index as geohash strings.",
  "since": "3.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": "bcd6047cdc7f85a452bb962b05783a25021195542b3fa08ad205c9de879bd5ee",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return valid [Geohash](https://en.wikipedia.org/wiki/Geohash) strings representing the position of one or more elements in a sorted set value representing a geospatial index (where elements were added using [`GEOADD`](https://redis.io/docs/latest/commands/geoadd)).\n\nNormally Redis represents positions of elements using a variation of the Geohash\ntechnique where positions are encoded using 52-bit integers. The encoding is\nalso different compared to the standard because the initial minimum and maximum\ncoordinates used during the encoding and decoding process are different. This\ncommand returns a standard Geohash in the form of a string as\ndescribed in the [Wikipedia article](https://en.wikipedia.org/wiki/Geohash)."
    },
    {
      "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 geospatial index (a sorted set).\n\n</details>\n\n<details open><summary><code>member [member ...]</code></summary>\n\nOne or more members whose Geohash strings to return.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "geohash-string-properties",
      "title": "Geohash string properties",
      "role": "content",
      "text": "The command returns 11 character Geohash strings, so no precision is lost\ncompared to the Redis internal 52-bit representation. The returned Geohashes\nhave the following properties:\n\n1. They can be shortened by removing characters from the right. They will lose precision but will still point to the same area.\n2. Strings with a similar prefix are nearby, but the contrary is not true, it is possible that strings with different prefixes are nearby too."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> GEOADD Sicily 13.361389 38.115556 \"Palermo\" 15.087269 37.502669 \"Catania\"\n(integer) 2\nredis> GEOHASH Sicily Palermo Catania\n1) \"sqc8b49rny0\"\n2) \"sqdtr74hyu0\""
    },
    {
      "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[Array reply](../../develop/reference/protocol-spec#arrays): an array where each element is the Geohash corresponding to each member name passed as an argument to the command.\n\n**RESP3:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): An array where each element is the Geohash corresponding to each member name passed as an argument to the command."
    }
  ],
  "examples": []
}
