Geohash decoder
Paste a geohash such as u4pruydqqvj and get the center latitude and longitude of its cell, plus margins that show how wide the cell is; eleven characters narrow it to a few meters. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Geohash string to decode
- u4pruydqqvj
- Latitude
- 57.6491106302
- Longitude
- 10.4074396938
- Lat error
- 0.0000006706
- Lon error
- 0.0000006706
This geohash decoder turns a compact geohash string into a center latitude and longitude plus the half-cell error margins that describe how large the encoded cell is. Geohashes are a base-32 spatial index used in databases, maps, logistics, and IoT to bucket nearby points without storing full floating-point coordinates on every key. The decoder follows the classic interval-bisection algorithm: each character contributes five bits that alternate between longitude and latitude, shrinking the world window from plus or minus one hundred eighty degrees in longitude and plus or minus ninety degrees in latitude down to a small rectangle whose center is the reported point.
What a geohash encodes and what this decoder returns
A geohash packs a geographic region into a short base-32 string by interleaving bits of longitude and latitude. Longer strings mean smaller cells: a one-character geohash is a vast strip of the planet, while eleven or twelve characters pin a point to roughly a few meters or less depending on latitude. This tool does not invent a custom encoding; it implements the widely used open algorithm so that strings produced by common libraries decode to the same center and the same error half-widths.
There is no reverse geocoding, no map tiles, and no address lookup: if you need a street name, use a geocoder; this page answers only the pure geometric decode of the cell.
How the input is validated and how bits become lat and lon
Input is trimmed and lowercased; the allowed alphabet is zero through nine and the letters b through z excluding a, i, l, and o, matching the standard base-32 set used by geohash implementations worldwide. Length is capped at twenty-two characters, which is far beyond everyday map precision and keeps pathological inputs from wasting CPU.
Decoding starts with longitude in the interval negative one hundred eighty to one hundred eighty and latitude in negative ninety to ninety; for each of the five bits of a character from most significant to least, the decoder bisects the active axis and keeps the upper or lower half according to the bit, then flips to the other axis. After all characters, the center is the midpoint of each remaining interval and the error margin is half the interval width, which is the conventional way to report cell uncertainty.
Where geohash decoding fits in products, data, and study
Engineers meet geohashes when a Redis or Elasticsearch index keys rows by spatial prefix, when an IoT device emits a short cell id instead of full coordinates, or when a privacy-preserving pipeline buckets users into neighborhoods without storing exact homes. Logistics and delivery tools expand a geohash to a center and an error box before drawing a rough service area or deciding whether two packages share a last-mile zone.
Mobile and web map prototypes often receive geohashes from partner APIs and must plot a pin at the cell center with a halo sized from the error margins rather than a hard point. Students and interview candidates use a decoder to verify hand-worked bisection steps and to confirm that a five-character string really covers a city-scale region while a nine-character string is neighborhood-scale. Data teams validate imported CSV columns by decoding samples and asserting that centers fall inside expected country bounding boxes before loading billions of rows.
Pair it with other geo or encoding tools when you are building a small lab of free, deterministic helpers for spatial keys.
What you can do with it
Spatial index inspection
Expand database or search-index geohash keys into center lat/lon and cell size for debugging and dashboards.
Map pins and service areas
Plot a geohash as a center point with an error-derived halo or bounding box on maps and logistics UIs.
FAQ
What does the geohash decoder cost?
It is free in your browser on this page.
Does longer geohash mean higher precision?
Yes. Each extra character adds five bits and shrinks the cell. The precision field in the response is the character length of the decoded string.
Can this tool encode latitude and longitude into a geohash?
No. This capability only decodes an existing geohash string into coordinates and error margins.
What do the error margins of a decoded geohash mean?
A geohash names a small rectangle, not a single point. The decoder reports its center, and each margin is half the rectangle's height or width in degrees, so the real location lies within that distance of the center.
Why is my geohash rejected as invalid?
Geohashes use only the digits 0 to 9 and the letters b to z without a, i, l and o. Spaces inside the text, punctuation or strings over 22 characters are refused, and the tool points to the offending character and its position.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/geohash-decode \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"geohash":"u4pruydqqvj"}'const res = await fetch("https://api.kit.forhosting.com/geo/geohash-decode", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"geohash": "u4pruydqqvj"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/geohash-decode",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"geohash": "u4pruydqqvj"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/geohash-decode", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"geohash":"u4pruydqqvj"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"geohash":"u4pruydqqvj"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/geohash-decode", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"geohash": "u4pruydqqvj"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.geohash_decode",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_len | 22 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Characters outside the geohash alphabet — including the letters a, i, l, and o — are rejected with a clear invalid_input message so bad tokens never become silent wrong coordinates.
What a geohash encodes and what this decoder returns
The response includes the normalized lowercase geohash, the center latitude and longitude as IEEE doubles, separate lat_error and lon_error fields for the half extents of the cell, a nested error object with the same two numbers for callers that prefer a structured shape, the full bounding_box with min and max latitude and longitude, the character precision, and a method tag geohash_decode for telemetry. Invalid characters, empty strings, and overlong inputs fail fast with invalid_input so pipelines can distinguish bad payloads from real locations without guessing.
How the input is validated and how bits become lat and lon
The preferred field is geohash, with aliases hash, g, text, and value so query strings, form fields, and spreadsheet exports can reuse the same contract without renaming columns. Any character outside that set — including spaces, punctuation, or the forbidden letters — triggers invalid_input with the offending character and its position so you can fix the source quickly.
Where geohash decoding fits in products, data, and study
On this page the work runs entirely in your browser; through the API each successful decode costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a map demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible latitude, longitude, and error margins for unit tests and CI without floating guesswork.
Technical questions
Which characters are allowed in a geohash?
Only the base-32 alphabet 0123456789bcdefghjkmnpqrstuvwxyz (case-insensitive). Letters a, i, l, and o are not used and any other character causes invalid_input.
What are lat_error and lon_error?
They are half the height and half the width of the decoded cell. The true point lies inside the bounding box of center ± those margins.