On a map, dr5r7p4 appears as a small rectangle near the Statue of Liberty. A pin at its center is convenient, but the original observation could have been near any edge.
A Geohash encodes a location as a string of letters and numbers. Each character refines a rectangular latitude–longitude cell, so a longer prefix identifies a smaller part of the same region. Decoding gives geographic bounds or a representative center. The original point could have been anywhere inside that cell.
Compare prefix lengths · Measure a cell · Check a neighboring cell
Geohash length and cell size
A point at 40.6892° N, 74.0445° W falls within these nested Geohash cells. Each row retains every character from the previous row. The extra character selects one of 32 children.
| Code | Latitude span | Longitude span |
|---|---|---|
| dr5r7 | 0.043945° | 0.043945° |
| dr5r7p | 0.005493° | 0.010986° |
| dr5r7p4 | 0.001373° | 0.001373° |
Compare successive prefix lengths
The alternating cell shapes follow from the encoding. Geohash alternates longitude and latitude subdivisions and stores five binary decisions per character. Sometimes a new character contributes more subdivisions to one axis than the other.
What latitude and longitude do you get from a Geohash?
The cell dr5r7p4 spans roughly 40.687866° to 40.689240° N and −74.045105° to −74.043732° longitude. Its center is about 40.688553, −74.044418. The original latitude was 40.6892°, near the northern edge. Both positions are consistent with the same code.
Measure the Liberty Island cell
At this latitude the cell is about 381 ft (116 m) across and 500 ft (153 m) from south to north. Matching angular spans need not give matching dimensions on the ground. PostGIS exposes separate functions for a Geohash bounding box and its center point, giving you an explicit choice.
Can nearby places have different Geohashes?
Two locations with the same prefix lie inside the same parent cell. The reverse is weaker. Two locations can be close while falling on opposite sides of a cell boundary. For example, at latitude 0.00001°, the point at longitude −0.00001° encodes as ebpbpbp. Move east to longitude +0.00001° and the code becomes s000000. The points are about 2.2 meters apart, yet even the first character changes.
Search across a cell edge
For a nearby search, consider neighboring cells or use an appropriate spatial-distance query. A common-prefix filter alone can miss a point just across an edge. To explore one value in several geographic formats, use the Geohash decoder with the Liberty Island sample. To measure separation, use the distance between coordinates calculator.
Frequently Asked Questions
Can I recover the original coordinates from a Geohash?
You can recover its bounding box and select a representative point such as its center. A Geohash alone does not record where the original point fell inside the box.
Are two points with the same Geohash at the same location?
They share a cell at that code length. The possible separation depends on the cell’s dimensions and where each point lies inside it.
Is a Geohash a secure way to hide an address?
Geohash is a reversible location encoding. A recipient can decode the cell without a secret key. Its length and surrounding information affect how precisely that area can be identified.
What Did We Learn Today?
Use a Geohash prefix to group points in the same rectangle. Use the bounds to describe the area and the center only when you need a representative pin. Selecting nearby locations also requires checking what lies across cell edges.
Sources & Data Notes
View sources and data notes
Examples were checked by interval bisection and the ngeohash implementation. WGS 84 geodesic calculations approximate the ground width at the middle latitude and the height along a meridian. The three prefix spans and quoted bounds are rounded.
