What Is Geocoding?

Geocoding turns a place description such as an address or landmark name into map coordinates. Here is what happens between the text you type and the latitude and longitude you get back.

Geocoding is the process of converting a description of a place, usually a street address, a place name or a postal code, into geographic coordinates: a latitude and a longitude. Its mirror image, turning coordinates back into a readable address, is called reverse geocoding and is covered in our guide to forward vs reverse geocoding. This article explains what a geocoder actually returns, the steps it goes through to get there, and the reasons it sometimes gets the answer wrong.

What a geocoder returns

People tend to think of a geocoding result as "a pin on the map", but a useful response carries considerably more than a single point. Here is a trimmed response from OpenStreetMap's Nominatim geocoder for the query Eiffel Tower, Paris, as returned at the time of writing:

{
  "osm_type": "way",
  "lat": "48.8582599",
  "lon": "2.2945006",
  "category": "man_made",
  "type": "tower",
  "place_rank": 30,
  "importance": 0.6205937724353116,
  "name": "Tour Eiffel",
  "display_name": "Tour Eiffel, 5, Avenue Anatole France, Quartier du Gros-Caillou, Paris 7e Arrondissement, Paris, Île-de-France, France métropolitaine, 75007, France",
  "boundingbox": ["48.8574753", "48.8590453", "2.2933119", "2.2956897"]
}

Four kinds of information are packed in here:

Coordinates
A representative point for the feature. For a building or an area this is typically a centroid, not the front door. Note that latitude comes first in this JSON, while GeoJSON and most GIS formats put longitude first; our guide to latitude and longitude covers that trap.
A bounding box
The rectangle that encloses the feature. Here it measures roughly 175 m by 175 m. For a city it might be tens of kilometers across, which is a strong hint about how precise the point really is. See geographic bounding boxes explained.
A structured address and classification
The matched feature's name, type (here an OSM man_made=tower) and an address broken into components such as road, suburb, city, postcode and country.
A ranking signal
Nominatim reports importance, a computed rank used to order candidates, and place_rank, which indicates the feature's level in the address hierarchy (30 is the most detailed, such as a building or point of interest). Other geocoders expose a match "confidence" or an accuracy class instead. Treat these as relative ranking hints within one service, not as calibrated probabilities.

How a geocoder works under the hood

Implementations differ, but almost every geocoder runs some version of the same pipeline.

The geocoding pipeline: parse, normalize, match, rank, locate, return Input: "5 av. Anatole France, Paris" 1 Parse number, street, city 2 Normalize av. → avenue 3 Match search the index 4 Rank score candidates 5 Locate rooftop or interpolate 6 Return lat, lon, bbox, rank Each stage can fail independently
A typical forward-geocoding pipeline. Real systems blur the boundaries, for example by matching and ranking in a single search query.

1. Parsing

The free-text query is split into labeled components: house number, street, unit, locality, region, postal code, country. This is harder than it looks, because address order varies by country (the house number follows the street name in Germany and precedes it in the US), commas are optional, and users mix in landmarks ("opposite the station"). Some engines parse with hand-written rules, others with statistical models trained on labeled addresses, and some skip explicit parsing and match tokens directly against an index.

2. Normalization

Each component is reduced to a canonical form so that different spellings of the same thing compare equal: lowercasing, stripping accents and punctuation, and expanding abbreviations such as av. to avenue, St to Street or N to North. The reference data is normalized the same way when the index is built.

3. Candidate matching

The normalized tokens are looked up in a search index built from a gazetteer (named places, administrative areas, points of interest) and from address data (streets with house numbers or address ranges). Matching is usually fuzzy, tolerating typos and missing words, and is constrained hierarchically: a street candidate should lie inside the city the user named.

4. Ranking

There are usually several candidates. The geocoder scores them on how many query tokens matched, whether the hierarchy is consistent, how specific the feature is, and how prominent it is. Prominence matters for short queries: "Paris" should return the French capital before Paris, Texas, which is the role a signal like Nominatim's importance plays.

5. Locating the point

Once a feature is chosen, the geocoder needs a coordinate for it, and the method determines the precision:

  • Rooftop or parcel points. The address exists as its own point or building outline in the data, so the result sits on the actual building or land parcel.
  • Interpolation along a street segment. Many datasets store a street segment with a house-number range for each side rather than individual addresses. In the US, the Census Bureau's TIGER/Line files are the classic example. The geocoder estimates the position proportionally. Suppose a 160 m segment carries even numbers 100 to 198 and you ask for number 150: the fraction is (150 − 100) / (198 − 100) = 0.51, so the point is placed about 82 m from the start of the segment, offset to the even side. If lots are unevenly sized, or numbers are skipped, the estimate can be off by several buildings.
  • Centroids. When nothing finer matches, the result falls back to the center of the street, postcode, town or region.

Precision levels

It helps to record which of these levels each result came from, because a "successful" geocode at the wrong level is a silent error.

LevelTypical sourceWhat the point represents
Rooftop / buildingAddress points, building footprintsThe structure itself
ParcelCadastral or land registry dataCenter of the land lot
InterpolatedStreet segments with number rangesAn estimate along the street
StreetRoad geometry without numbersSomewhere on the named street
Postal codePostcode centroids or areasCenter of a delivery area
Locality / regionGazetteer, admin boundariesCenter of a town, county or country

In Nominatim output, place_rank and the feature type are the practical clues: a result of type city for a query that included a house number means the street-level match failed.

Common failure modes

  • Ambiguity. "Springfield" is the name of a state capital (Illinois) and of cities in Massachusetts, Missouri, Oregon and elsewhere. Without a state or country, the geocoder has to guess, and prominence-based ranking will confidently pick one. Always pass the country, and the region if you have it.
  • Abbreviations that mean two things. "St" is Street or Saint; "Dr" is Drive or Doctor. "St Louis St" defeats naive expansion rules.
  • PO boxes and non-physical addresses. A PO box identifies a mailbox at a post office, not where anyone lives or works. The best a geocoder can do is the post office or the postcode centroid.
  • New developments. Streets and house numbers built in the last few months may not have reached the reference data yet, so the query falls back to street or postcode level.
  • Transliteration and multiple languages. Places have exonyms (Munich and München) and several Latin spellings of names written in Arabic, Cyrillic or Chinese script. A geocoder only matches the variants its data contains, which is why OSM data carries tags such as name:en and alt_name.
  • Units and noise. Apartment numbers, building names, floor numbers and delivery instructions add tokens that do not match anything. Strip them before geocoding and keep them in a separate field.

Where the data comes from

A geocoder is only as good as its reference data, which typically comes from three kinds of source:

  • OpenStreetMap. A global, volunteer-built map released under the Open Database License. Coverage of streets and places is very broad; house-number coverage varies a great deal from country to country and city to city. Nominatim is the reference geocoder built on OSM data, and our article on OpenStreetMap geocoding goes deeper.
  • National address registers. Many governments publish authoritative address points, for example France's Base Adresse Nationale and, in the United States, the Department of Transportation's National Address Database alongside the Census Bureau's TIGER/Line street ranges. Licensing and completeness differ by country.
  • Commercial datasets. Vendors combine government, postal and proprietary sources, and their terms often restrict how long you may store results.

OpenGeocoder's own address to coordinates tool uses OpenStreetMap data via Nominatim, proxied and cached on our server, and the place name search shows several candidates with their type and importance so you can see the ranking for yourself. Developers can call the same lookups through the OpenGeocoder JSON API, which is rate-limited for fair use.

Key takeaways

  • Geocoding converts place descriptions into coordinates, but a good result also includes a bounding box, a structured address, a feature type and a ranking signal.
  • The pipeline is parse, normalize, match, rank and locate; each stage has its own failure modes.
  • Rooftop, interpolated and centroid results can all look like the same pin. Record the precision level and check it.
  • Most bad geocodes come from ambiguous or incomplete input: always supply the country, and region where possible.