No Login Data Private Local Save

Geohash Encoder/Decoder - Online Lat/Lon to String

8
0
0
0

Geohash Encoder & Decoder

Convert between Latitude/Longitude and Geohash strings instantly

Range: -90 to 90
Range: -180 to 180
Level 7 — ~153m
1 (coarse) 12 (fine)
Enter a valid Geohash (1-12 characters, Base32: 0-9, b-z excluding a,i,l,o)
Geohash Precision Reference
Level Chars Lat Error Lon Error Approx. Grid Size Use Case
11±23°±23°~5,000 kmContinent level
22±2.8°±5.6°~1,250 kmCountry level
33±0.35°±0.7°~156 kmRegion level
44±0.044°±0.087°~39 kmCity level
55±0.0055°±0.011°~4.9 kmNeighborhood
66±0.00068°±0.0014°~1.2 kmStreet / block
77±0.000085°±0.00017°~153 mBuilding level
88±0.000011°±0.000021°~38 mEntrance / spot
99±0.0000013°±0.0000026°~4.8 mHigh precision
1010±0.00000017°±0.00000033°~1.2 mSurvey grade
1111±0.000000021°±0.000000042°~15 cmUltra precise
1212±0.0000000026°±0.0000000052°~3.7 cmMaximum precision
* Grid sizes are approximate and vary by latitude (narrower at higher latitudes for longitude).
Frequently Asked Questions

Geohash is a geocoding system invented by Gustavo Niemeyer that encodes a geographic location (latitude and longitude) into a short string of letters and digits. It uses a hierarchical spatial data structure that subdivides the Earth into grid cells. Each additional character refines the precision by a factor of roughly 32. The algorithm interleaves bits from latitude and longitude, then encodes each 5-bit chunk as a Base32 character (0-9, b-z excluding a, i, l, o to avoid confusion). Longer Geohash strings represent smaller, more precise areas.

Geohash is widely used for proximity searches, location-based indexing in databases (like Redis, MongoDB, Elasticsearch), and spatial partitioning in distributed systems. Common applications include: finding nearby points of interest (POIs), geofencing, ride-sharing matching algorithms, real-time tracking systems, and location-based sharding in distributed databases. The hierarchical nature allows efficient prefix-based queries—locations sharing a Geohash prefix are geographically close.

Each Geohash character adds approximately 5 bits of precision. A 7-character Geohash (like 9q8yyk8) pinpoints a location within roughly 153 meters, suitable for building-level accuracy. An 8-character Geohash narrows it to about 38 meters (entrance level). For most consumer applications, precision levels 7-9 offer the best balance between string length and spatial accuracy. Refer to the precision reference table above for detailed error margins at each level.

The Base32 alphabet used by Geohash (0123456789bcdefghjkmnpqrstuvwxyz) intentionally omits a, i, l, and o to prevent confusion with digits and to avoid forming potentially offensive English words. The letter 'l' looks like '1', 'o' looks like '0', and 'a' and 'i' could form unintended words when Geohash strings appear in URLs or databases. This design choice improves readability and reduces data entry errors.

Geohash uses rectangular grid cells based on latitude/longitude subdivision—simple and widely supported but has distortion near poles. H3 (by Uber) uses hexagonal cells on a geodesic grid, providing uniform area coverage and 6-direction adjacency, ideal for ride-sharing and analytics. S2 (by Google) uses a spherical projection with Hilbert curve filling for excellent spatial locality. Geohash remains popular for its simplicity, human-readability, and broad database support (Redis, PostGIS, Elasticsearch).

Yes! This is a fundamental property of Geohash. Locations that are geographically close will share a common Geohash prefix. For example, all locations in San Francisco share the prefix 9q8y. This makes Geohash extremely efficient for proximity queries—simply search for all records with a given prefix. However, be aware of edge cases: two points very close together but on opposite sides of a grid boundary may have completely different Geohash values. To handle this, always query the 8 adjacent grid cells as well.

Our decoder above automatically calculates the 8 adjacent Geohash cells (North, Northeast, East, Southeast, South, Southwest, West, Northwest). These neighbors are computed by decoding the Geohash to get its bounding box, offsetting the center point by the grid dimensions in each direction, and re-encoding at the same precision. This is essential for accurate proximity searches—always check the center cell plus all 8 neighbors to avoid edge-case misses.

No. Standard Geohash uses lowercase letters only (from the Base32 set: 0123456789bcdefghjkmnpqrstuvwxyz). While some implementations may accept uppercase input by normalizing it, the canonical representation is always lowercase. Our tool automatically converts uppercase input to lowercase for decoding.

Geohash handles latitudes from -90° to +90° and longitudes from -180° to +180°. At the poles, the grid cells become extremely narrow (longitude-wise), but the encoding remains valid. Near the 180th meridian (the International Date Line), points just east and west of the line will have very different Geohash values despite being geographically adjacent. This is a known limitation—use careful bounding box queries when working near the antimeridian.

Geohash is a machine-oriented hierarchical encoding optimized for database indexing and spatial queries. Plus Codes (by Google, also called Open Location Codes) are designed to be short and human-friendly, often used where street addresses don't exist. What3Words assigns three dictionary words to every 3mĂ—3m square, making it highly memorable but proprietary. Geohash excels in technical/backend applications, while Plus Codes and What3Words target end-user location sharing scenarios.