Geohash cell explorer
A geohash turns a latitude and longitude into a short string. Longer strings name smaller cells, and a cell’s hash starts with the hash of the bigger cell around it. That makes “find things nearby” an ordinary prefix lookup in a database index.
Your point falls in cell u4pruy, which is about 654 m wide and 611 m tall.
Your point or geohash
Each character adds 5 bits and shrinks the cell.
| Item | Value |
|---|---|
| Latitude range | 57.645264 to 57.650757 |
| Longitude range | 10.404053 to 10.415039 |
| Bits | 15 longitude + 15 latitude |
| North-west neighbour | u4prux |
| North neighbour | u4pruz |
| North-east neighbour | u4prvp |
| West neighbour | u4pruw |
| East neighbour | u4prvn |
| South-west neighbour | u4prut |
| South neighbour | u4pruv |
| South-east neighbour | u4prvj |
Why one cell is not enough
Two points 1 m apart, either side of this cell’s east edge, get u4pruy and u4prvn. They share only 4 of 6 characters. A shared prefix means “inside the same cell”, but a different prefix does not mean “far away”.
For a nearby search, query this cell and its eight neighbours, then filter the results by real distance. That covers a point near any edge or corner, as long as the cell is larger than the search radius.
| Characters | Bits | Width | Height |
|---|---|---|---|
| 1 | 5 | 1,915 km | 5,004 km |
| 2 | 10 | 643 km | 625 km |
| 3 | 15 | 85 km | 156 km |
| 4 | 20 | 21 km | 20 km |
| 5 | 25 | 2.6 km | 4.9 km |
| 6 | 30 | 654 m | 611 m |
| 7 | 35 | 82 m | 153 m |
| 8 | 40 | 20 m | 19 m |
| 9 | 45 | 2.6 m | 4.8 m |
| 10 | 50 | 64 cm | 60 cm |
| 11 | 55 | 8 cm | 15 cm |
| 12 | 60 | 2 cm | 1.9 cm |
Redis GEO packs 26 bits of longitude and 26 of latitude into a 52-bit score. At this latitude that is a cell about 32 cm × 28 cm, finer than a 12-character geohash (60 bits). It accepts latitudes only within ±85.05112878°.
What it shows
Cells have edges. Two points a metre apart can land in different cells with different prefixes, so a nearby search has to check the cell and its neighbours, not just one cell.
Enter a point and a precision to see its geohash, the size and bounds of its cell, and the eight cells around it. Or paste a geohash to decode it back to a cell. An optional view shows how longitude and latitude bits are interleaved.
How to read it
- The grid shows your cell in the middle and its eight neighbours, with north at the top.
- A neighbour reads “none” past a pole. Neighbours across the 180th meridian wrap around.
- Each character is 5 bits, so n characters give 5n bits. Longitude gets the first bit, then the two alternate.
- Odd lengths make cells square in degrees; even lengths make them twice as wide as tall.
- Cell size is computed on a sphere, so it is approximate. Width shrinks towards the poles; height stays almost the same.
- “Why one cell is not enough” takes two points about a metre either side of the east edge and shows how little of their hashes they share.
Questions
How many characters should I use?
Pick a cell a little larger than your search radius, so a radius search needs at most the cell and its neighbours. For a 500 m radius that is about 6 characters at mid latitudes. Cell width depends on latitude, so check the table.
Why do nearby points sometimes have different prefixes?
Cells are fixed rectangles. A point just across an edge is in the next cell, and at the biggest splits, such as the equator or the prime meridian, even the first character differs. That is why searches include the neighbouring cells.
Why is geohash.org not linked?
The original geohash.org site now redirects elsewhere. The sources below are an archived copy of its announcement and tips page, the Wikipedia article and the Redis documentation.
Does a longer shared prefix always mean closer?
No. A longer shared prefix means a smaller shared cell, so the points are within that cell’s size of each other. The reverse fails: close points can share little or nothing.
How is this different from what Redis does?
Redis stores a 52-bit integer made the same way, longitude and latitude bits interleaved, 26 bits each. It reads it as a sorted-set score and searches the matching cell and its neighbours, then filters by distance.
Learn it properly
Sources
Explore further
- H3Uber’s hexagonal grid, an alternative to geohash cells for spatial indexing.
Last updated
More tools
All tools- estimatorBack-of-envelope estimatorTurn daily users into requests per second, storage and bandwidth, with the working shown.Open tool
- simulatorConsistent hashing simulatorA hash ring with virtual nodes: key spread per node, and how many keys move when the cluster changes.Open tool
- estimatorQueue latency estimatorWhy latency explodes as servers get busy: utilisation, waiting time and Little’s law.Open tool