Developer · Geo
Geohash decoder & encoder.
Decode a geohash to its bounding box and centre point, or encode latitude and longitude at a precision from 1 to 12. Includes the cell-size table and the eight neighbouring cells. Runs in your browser; nothing is sent or stored.
How it works: each character is one base-32 digit (5 bits) from the alphabet 0123456789bcdefghjkmnpqrstuvwxyz. Bits alternate longitude, latitude, longitude… starting with longitude; each bit halves the current interval (1 = upper half). Example: ezs42 decodes to centre 42.605, −5.603.
Decode
Encode
Result
Enter a geohash and press Decode, or enter coordinates and press Encode.
How a geohash works
A geohash is a short string that names a rectangular cell on the Earth. Longitude (−180 to 180) and latitude (−90 to 90) are repeatedly bisected, alternating between them and starting with longitude; a 1 bit keeps the upper half, a 0 bit the lower. Every five bits become one character of the base-32 alphabet. Longer hashes give smaller cells, and a hash’s prefix is always the larger cell that contains it.
Cell size by precision
| Characters | Bits (lon + lat) | Width × height (degrees) | Approx. width × height |
|---|
Neighbours: the eight cells around a hash are found by stepping one cell width or height from the cell centre and re-encoding at the same precision. Longitude wraps across ±180; cells beyond a pole do not exist and are shown as “none”.
Worked check: ezs42 gives longitude range −5.625 to −5.581 and latitude range 42.583 to 42.627, centre 42.605, −5.603, matching the Wikipedia article. Encoding 57.64911, 10.40744 at 11 characters gives u4pruydqqvj.
Not a validity check on a place
Any string of valid characters decodes to some cell, so “valid” here means well-formed only. Centre points are the middle of the cell, not the original coordinate that was encoded.
Sources
- Wikipedia, Geohash (alphabet, longitude-first bit order, ezs42 and u4pruydqqvj examples; algorithm placed in the public domain by its inventor, 26 February 2008)
- vinsci/geohash, Geohash/geohash.py (maintained Python reference implementation; same alphabet and bisection)
Privacy
This tool runs entirely in your browser. Nothing you type is transmitted, stored or logged. A geohash can pinpoint a home; avoid pasting locations you do not want to reveal.