What the Coordinates to Postal Code does
Give this tool a latitude and longitude and it returns the postal codes nearest to it in the GeoNames dataset vendored on this site, each with the distance from your point, the bearing and the administrative divisions the dataset records. It is a nearest-record search, not a reverse geocoder: it works offline, it never produces a street address, and it always tells you how far away the answer is.
That distance is the honest part. A reverse geocoder hands back a formatted address and lets you assume it is right. Here you can see that the nearest recorded code is 300 metres away in a city, or 240 kilometres away at sea - and treat the two results very differently.
How to use it
- Choose the country whose postal file should be searched. The search is against one country's records at a time, so a point in the wrong country returns distant matches and flags them.
- Paste one coordinate per line. Decimal degrees, degrees-minutes-seconds and degrees with decimal minutes are all accepted, latitude first, with hemispheres as signs or as N/S/E/W.
- Choose how many nearest codes to return per point - one for a quick answer, five or more when you want to see how tightly the codes cluster around the point.
- Read the distance column before the code column. A code 400 metres away describes your point; a code 40 kilometres away barely mentions it.
- Export CSV or JSON, or copy the one-line-per-point summary for pasting into a ticket or a spreadsheet.
Reading the results
The nearest record is the nearest record, no more. Postal codes cover areas; the dataset stores one representative point per record, so the closest point does not guarantee that your coordinate lies inside that code's boundary.
Anything beyond 25 kilometres is flagged. At that distance the result is telling you about the coverage of the dataset rather than about your point - thin rural coverage, a point offshore, or the wrong country selected all look identical.
The bearing says which way the code's point lies from yours, on the 16-point compass. With several results it shows whether your point sits inside a cluster of codes or on the edge of one.
Admin 1 and admin 2 are usually the more robust answer. Even when the nearest code is a few kilometres off, its state and district are very likely to be the right ones.
Worked example: a point at India Gate, and one in the Bay of Bengal
Searching India for 28.6128, 77.2292 returns five codes whose representative points are all within about three kilometres, every one of them in admin 1 Delhi. The nearest is a few hundred metres away, bearing roughly north-west. Nothing is flagged, and the admin divisions are unambiguous.
Searching the same country for 15.0, 88.0 - open water in the Bay of Bengal - returns codes more than 200 kilometres away, every one of them flagged. The page still shows them, because they genuinely are the nearest records, but it says plainly that a match at that distance describes the dataset rather than the point.
A reverse geocoder would have answered the second query with a confident-looking place name. This one answers it with a distance, which is the more useful fact.
Formulas and scoring rules
- Great-circle distance
d = 2R asin(sqrt(sin^2((lat2-lat1)/2) + cos(lat1) cos(lat2) sin^2((lon2-lon1)/2)))Haversine on a sphere of mean radius R = 6,371,008.8 m. Good to about 0.3 per cent against the ellipsoid.- Initial bearing
theta = atan2(sin(dlon) cos(lat2), cos(lat1) sin(lat2) - sin(lat1) cos(lat2) cos(dlon))Normalised to 0-360 degrees from true north, then named on the 16-point rose.- Miles
miles = metres / 1609.344The international mile, exactly 1,609.344 m.- Far-match threshold
flag when distance > 25 kmA convention of this page, chosen so that a normal urban or suburban match never trips it and a genuinely thin result always does.
How this differs from Address by Latitude and Longitude
The existing Address by Latitude and Longitude tool sends the point to Google's reverse geocoder and gives you a formatted postal address - the right answer when you want an address and are happy for the coordinate to leave your machine. This page does something different and does it offline: it returns the nearest postal codes in a vendored dataset, each with its distance and its administrative divisions, so you can judge the quality of the match yourself. Use that one for an address; use this one for postal-code assignment, catchment work, or any coordinate you would rather not send anywhere.
Limitations: what the result does not prove
- This is not reverse geocoding. There is no street, no building and no formatted address - only the nearest records in an open postal dataset.
- Nearest is not inside. The dataset holds a representative point per record, not a boundary, so a point can be closest to one code while lying within another.
- Coverage varies by country and several countries publish only part of their codes. Where the nearest record is far away, that usually says more about the data than about your coordinate.
- One country is searched at a time. A point near a border will not be matched against codes on the other side of it unless you search that country too.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- GeoNames postal code export (CC BY 4.0) - checked 19 Sep 2026
- Creative Commons Attribution 4.0 International licence - checked 19 Sep 2026
- NGA - World Geodetic System 1984 (WGS 84) - checked 19 Sep 2026
Frequently asked questions
Is this the same as reverse geocoding?
No. Reverse geocoding turns a coordinate into an address using a road and address database, usually through a paid service. This returns the closest entries in an open postal dataset with the distance to each one, which is a smaller and more honest claim - and it happens entirely in your browser.
Why is the nearest postal code so far from my point?
Either the dataset covers that country thinly, your point is offshore or in unpopulated land, or the wrong country is selected. The page flags anything beyond 25 kilometres for exactly this reason, because a distant match looks the same as a good one if you only read the code.
Does my coordinate get sent anywhere?
No. The country's postal file is downloaded from this site and searched inside your browser. The coordinate you type is never transmitted, which matters when the point is someone's home, a site under survey or anything else you would rather not log with a third party.
Can I find which postal code a point is actually inside?
Not from this data. Determining containment needs postal boundary polygons, which are licensed products in most countries and are not part of the open GeoNames export. Nearest-point matching is the honest approximation, which is why the distance is always shown.
What coordinate formats can I paste?
Decimal degrees (28.6128, 77.2292), degrees-minutes-seconds (28° 36' 46" N, 77° 13' 45" E) and degrees with decimal minutes (28° 36.768' N) all work, with hemispheres written either as a sign or as N, S, E or W. Latitude comes first.
How many points can I look up at once?
Two hundred per run, each returning up to twenty nearest codes. The country file loads once and is reused, so repeated runs against the same country are immediate.
Which is more reliable, the code or the administrative division?
The division, usually. A representative point a few kilometres out can belong to the neighbouring postal code while still sitting in the correct district and state, so if you are aggregating by region the admin columns are the safer key.
Last reviewed by the A2Z.Tools team against the sources listed above.