Cell & Shape

Geohash Map — explore geohash cells and precision levels

Visualize geohash cells on a real map. Pan and zoom to draw the base-32 grid at any precision, tap a cell to read its hash, and share the exact view with a link. Everything runs in your browser — no coordinates are uploaded.

How geohash works

A geohash turns a coordinate into a short text key. It repeatedly bisects the world — halving longitude, then latitude, then longitude again — recording a 1 or 0 each time. Interleaving those two bit streams traces a Z-order (Morton) curve, and every 5 bits become one base-32 character (digits and lowercase letters, with a, i, l, o removed to avoid look-alikes).

The useful consequence is the prefix property: a longer geohash is always contained inside its shorter prefixes, so 9q8yy7 sits inside 9q8yy sits inside 9q8. A prefix match is a cheap "is this point in that box" test, and truncating a hash zooms out to a coarser cell.

The boundary caveat (read this before you rely on prefixes)

The prefix property has a sharp edge that surprises people. The grid is a fixed lattice, so proximity in space does not guarantee proximity in the string. Two points a metre apart that happen to fall on opposite sides of a cell boundary can share a short prefix — or none at all.

A point just west of the prime meridian near London encodes to gcpuzz; a point just east of it encodes to u10hbp. They are neighbours on the ground but share zero characters, because the meridian is a top-level cell boundary. So "different prefix" never means "far away." To find real neighbours you must compute the eight adjacent geohashes explicitly rather than trusting string similarity — which is exactly why a proximity search usually queries a cell plus its 8 neighbours.

Geohash length → approximate cell size

Each character adds 5 bits and shrinks the cell by 32×, alternating between splitting longitude and latitude — which is why odd lengths are wider than tall. Sizes below are approximate and measured at the equator; because cells are latitude/longitude rectangles, real ground width narrows as you move toward the poles.

LengthApprox cell size (equator)Rough scale
3~156 km × 156 kma small country / region
4~39 km × 20 kma metro area
5~4.9 km × 4.9 kma town / district
6~1.2 km × 0.6 kma neighbourhood
7~153 m × 153 ma city block
8~38 m × 19 ma building
9~4.8 m × 4.8 ma room / parcel

Geohash across the stack

Geohash's biggest advantage is that it is just a string, so it drops into infrastructure you already run:

Encode and find neighbours with ngeohash
import ngeohash from 'ngeohash';

// point → geohash (lat, lng, precision)
const hash = ngeohash.encode(37.77, -122.42, 6); // "9q8yy7"

// the box this hash covers: [minLat, minLng, maxLat, maxLng]
const bbox = ngeohash.decode_bbox(hash);

// the 8 surrounding cells — use these, not string similarity
const around = ngeohash.neighbors(hash);

Have a geohash and want it as a polygon, WKT, or GeoJSON? Paste it into the universal geometry inspector — it detects geohash, draws the cell, and re-exports it in any supported format.

Frequently asked questions

What is a geohash?
A geohash is a short base-32 string that encodes a latitude/longitude area. It works by interleaving the bits of longitude and latitude — a Z-order (Morton) curve — and grouping them 5 bits at a time into base-32 characters. Each extra character narrows the box to one of 32 sub-cells, so "9q8yy" is a coarse cell and "9q8yy7" is a finer cell inside it.
Do nearby points always share a geohash prefix?
Usually, but not always — and this is the classic trap. Because the grid is a fixed lattice, two points a metre apart that happen to straddle a cell boundary can share a short prefix or none at all. Just west of the prime meridian encodes to "gcpuzz" while just east encodes to "u10hbp": zero shared characters despite being neighbours. Never treat "different prefix" as "far apart"; to find true neighbours, compute the 8 adjacent geohashes explicitly.
How big is a geohash cell at each length?
Approximately, at the equator: 4 characters ≈ 39 km × 20 km, 5 characters ≈ 4.9 km × 4.9 km, 6 characters ≈ 1.2 km × 0.6 km, 7 characters ≈ 153 m × 153 m, 8 characters ≈ 38 m × 19 m. Odd lengths give wider-than-tall cells because longitude gets the extra bit. These are equator figures — real ground width shrinks toward the poles since cells are lat/lng rectangles.
Geohash vs H3 or S2 — when should I use geohash?
Reach for geohash when you want a plain string key with a prefix hierarchy that drops into any database, cache, or search engine with no special library — Redis, Elasticsearch, and PostGIS all speak it natively. Prefer H3 or S2 when you need uniform cell size and clean neighbour relationships for analytics, since geohash cells distort toward the poles and its neighbours sit at unequal distances.
Why are geohash cells taller in some places and wider in others?
Two effects. First, geohash alternates which axis gets each refining bit, so even-length geohashes are square-ish while odd-length ones are wider than tall. Second, a geohash cell is a fixed span of degrees, and a degree of longitude covers less ground the farther you are from the equator — so the same geohash length is physically narrower near the poles.