ForHosting KIT · Travel & geography

Geohash neighbors finder

Enter one geohash and get the eight cells around it, from north round to northwest: u4pruyd has u4pruyf to its north and u4pruye to its east, all with the same number of characters. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Geohash string
u4pruyd
You get
Precision
7
N
u4pruyf
Ne
u4pruyg
E
u4pruye

A geohash neighbors finder turns one cell identifier into the eight cells that share an edge or a corner with it. Paste a base32 geohash—any precision from one to twelve characters—and the tool walks the classic even-odd neighbor tables to emit north, northeast, east, southeast, south, southwest, west, and northwest at the same length. Spatial indexes, proximity caches, and map tiles often need that Moore neighborhood without decoding every cell to latitude and longitude first.

What geohash adjacency means on the grid

A geohash encodes a latitude-longitude rectangle as a short base32 string by interleaving longitude and latitude bits and grouping them into five-bit characters. Adjacent cells at the same precision are the eight Moore-neighborhood rectangles that touch the centre cell along an edge or a corner.

Because bits alternate by parity, the character that sits immediately north of a given last character is not the same table when the string length is even versus odd; production-quality neighbor walkers therefore keep two lookup strings per direction plus a border table that says when the last character forces a parent-level step. East and west neighbors wrap the antimeridian so a cell on the far-right edge of the globe has a sensible eastern neighbour on the far left.

North and south do not wrap through the poles: if a cell already sits on the northern or southern edge of the global grid, asking for a further step in that direction is out of range and this tool rejects it. Precision is preserved end to end—if you pass seven characters you get seven-character neighbours—so you can join the result set straight into the same index bucket family without re-encoding.

Expand a cell for proximity queries

Backend services that index points by geohash query the centre cell plus its eight neighbors to catch points that fall just across a cell boundary.

Map tile and heat-map rings

Visualization pipelines expand a selected geohash into the Moore neighborhood to highlight adjacent tiles without decoding every cell to lat/lon first.

What does this geohash neighbors tool return?

The eight same-precision adjacent cells: north, northeast, east, southeast, south, southwest, west, and northwest, plus a neighbors object, ordered list, and precision.

Does this encode or decode latitude and longitude?

No. It only expands an existing geohash string into its eight adjacent cells at the same precision.

Is the geohash neighbors finder free?

The browser tool is free and runs locally.

Why query the neighboring cells instead of just one geohash?

Two points very close to each other can fall on opposite sides of a cell border and get different geohashes. Searching the center cell plus its eight neighbors catches those points, so a proximity search does not miss nearby results.

What happens with a cell on the northern or southern edge of the grid?

North and south do not wrap through the poles, so a step past the top or bottom edge of the global grid is rejected. East and west do wrap across the antimeridian, so the far eastern edge continues on the far western side.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/geohash-neighbors

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/geohash-neighbors \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"geohash":"u4pruyd"}'
{
  "geohash": "u4pruyd"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.geohash_neighbors",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_precision12
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Invalid alphabet characters, empty strings, overlong precision, and polar-edge north or south steps return a clear invalid_input error instead of a silent wrong cell.

How to call the API and what comes back

The value must be one to twelve characters from the geohash base32 alphabet zero through nine and the letters b c d e f g h j k m n p q r s t u v w x y z—letters a, i, l, and o are intentionally absent and will fail validation. Leading and trailing whitespace is trimmed and letters are lowercased before processing so mixed-case client input does not create two hashes for the same cell. Send a JSON body with one required string field geohash (aliases hash and gh). On success the response echoes the normalized geohash and its precision, returns a neighbors object with keys n, ne, e, se, s, sw, w, and nw, repeats those eight strings as top-level fields for flat consumers, provides list as an ordered array of the same eight values, sets count to eight, and includes a short English message. Failed validation—missing field, non-string, empty after trim, illegal character, precision above twelve, or a polar-edge north or south step—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Keep precision inside the published range of one to twelve characters; longer hashes are rejected so intermediate parent walks stay bounded and results stay interoperable with common library defaults. When building a k-ring larger than the immediate eight, call this tool on each frontier cell and deduplicate—the capability itself only returns the first ring so behaviour stays simple and cacheable. Prefer this capability when you already hold a geohash string and only need the eight same-precision adjacents; if your source is a coordinate pair, encode first with a dedicated encoder then expand. Prefer the primary field name geohash in new clients; the aliases hash and gh exist for short form posts and older snippets. Polar edges are rare at city-level precision but appear on one-character and some two-character hashes near the poles; treat invalid_input there as a hard boundary rather than inventing a flipped cell. This landing targets people searching for geohash neighbors, adjacent geohash cells, or a geohash north-south-east-west finder; it is not a lat-lon encoder, not a decoder to bounding boxes, and not a radius search in kilometres. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when you probe invalid alphabets on purpose. Round-trip checks are easy: pick a well-known sample such as dqcjq, confirm the eight neighbours match a trusted library, then assert that an invalid character like letter a always fails with the documented error code.

Unit tests for geohash libraries

Generate deterministic expected neighbor maps for even and odd precision, plus invalid alphabet and polar-edge rejections, for coding kata and library golden files.

Which characters are valid in a geohash?

Base32 digits 0–9 and letters bcdfghjkmnpqrstuvwxyz. Letters a, i, l, and o are not used and trigger invalid_input.

Do east and west wrap around the globe?

Yes. Longitude wraps at the antimeridian. North and south do not wrap through the poles; polar-edge steps return invalid_input.

Read the full KIT documentation →