What Is Geocoding? A Practical Introduction
Geocoding converts street addresses to lat/lng (forward) and lat/lng back to addresses (reverse).

Every time you type an address into a map app and a pin drops in the right place, geocoding did the work. It is the translation layer between how humans describe places ('1600 Pennsylvania Avenue') and how machines locate them (38.8977, β77.0365). This guide explains forward and reverse geocoding, how the matching actually works, what accuracy levels mean, and how to choose a geocoding service.
Forward geocoding: address to coordinates
Forward geocoding takes a human-readable address and returns latitude and longitude. Type 'Eiffel Tower' or 'Champ de Mars, 5 Avenue Anatole France, 75007 Paris' and you get back approximately 48.8584, 2.2945. Under the hood, the geocoder parses your text into components (street, number, city, postcode, country), searches its reference database for matches, scores them, and returns the best candidate's coordinates. Good geocoders handle misspellings, abbreviations ('St' vs 'Street'), partial addresses and multiple languages. The output is always an interpretation β 'the coordinates the geocoder believes best match your text' β not a surveyed fact. Treat every geocoding result as a best guess until you verify it.
Reverse geocoding: coordinates to address
Reverse geocoding goes the other way: given a lat/lng, it returns the nearest address or named place. Tap a point on a map at 40.6892, β74.0445 and you get 'Statue of Liberty'. The geocoder searches its spatial index for the closest address point, street segment or locality, and returns the best description it has. Precision varies enormously: in a dense city with address-level data you get a house number; in rural areas you may get only the nearest village or road name; at sea you get the nearest named water body or nothing. Reverse geocoding powers 'what is here?' features, photo geotagging, and fleet tracking dashboards.
How the matching actually works
A geocoder's quality lives in its reference data and matching pipeline. First, parsing: the input is tokenised and normalised ('N' β 'North', 'Ave' β 'Avenue'). Then candidate retrieval: the index is searched for matching streets, localities and postcodes. Then scoring: candidates are ranked by text similarity, and the address components are reconciled β a street that exists in the named city outranks a same-named street elsewhere. Finally, interpolation or point lookup produces coordinates (see below). The best systems also return match metadata: how confident the match is and which level (rooftop, street, city) it reached β information you should always check before trusting a result for anything important.
Rooftop vs interpolated: accuracy levels
Not all geocoded coordinates are equal. Rooftop (or parcel) geocoders have actual building footprint data and return coordinates at the building itself β accuracy around a metre, the gold standard. Interpolated geocoders estimate: if number 10 is at one end of a street segment and number 20 at the other, number 15 is placed halfway along β reasonable on regular streets, wrong on irregular ones, typically 10β50 m off. Locality-level matches just return the city centre. When a geocoder returns a result, the accuracy level tells you which you got. For delivery routing or emergency dispatch, rooftop matters; for 'show me roughly where this is', interpolation is fine.
Common APIs and services
The most widely used services: Google Maps Geocoding API (excellent global coverage, commercial, pay-per-request); OpenStreetMap Nominatim (free, open data, but with strict fair-use limits β about one request per second β and no bulk commercial use without self-hosting); Mapbox Geocoding (commercial, strong on forward geocoding with autocomplete); HERE Geocoder (commercial, strong in automotive/logistics). Open-source self-hosted options include Pelias and Photon, which let you run geocoding on your own servers with OpenStreetMap data. Choice criteria: coverage in your countries, rate limits and pricing at your volume, whether you need autocomplete, and data licensing for your use case.
Batch geocoding: thousands of addresses
Geocoding one address is trivial; geocoding a million is an engineering project. Commercial providers offer batch endpoints with per-request pricing β budget accordingly, because costs scale linearly and large jobs get expensive. Practical rules: deduplicate and clean addresses first (every malformed address wastes money and returns junk); cache results aggressively (addresses rarely move); respect rate limits or you will be throttled; and store the match confidence and accuracy level alongside the coordinates so you can filter out city-level matches masquerading as precise ones. For ongoing large-scale needs, self-hosting Pelias or Photon on OpenStreetMap data is often cheaper than API bills within months.
Privacy and address data
Addresses are personal data in most jurisdictions. Sending customer addresses to a third-party geocoding API is a data transfer with legal implications β check your provider's data processing terms and retention policies (some commercial APIs retain query data; Nominatim's usage policy is stricter in the other direction, forbidding bulk scraping). For sensitive applications, self-hosted geocoders keep addresses inside your infrastructure. Also consider what you store: keeping raw addresses alongside coordinates doubles your exposure; keeping only the coordinates (or aggregated areas) is often enough and much safer.
International addresses are hard
The 'street, number, city, postcode' model is not universal. Japan's addresses are block-based (district-block-building, no street names in most areas). Many Middle Eastern and South Asian addresses are landmark-based ('behind the central mosque'). Rural addresses worldwide may be just a village name. Postcode formats, administrative hierarchies and even the order of components vary by country. A geocoder's quality in your specific countries matters more than its global marketing claims β always test with a sample of your real addresses, including the messy ones, before committing.
Geocoding vs geolocation vs geotagging
Three similar terms that are often confused. Geocoding converts between addresses and coordinates, as this guide describes. Geolocation determines a device's current position β via GPS, Wi-Fi databases, cell towers or IP address β without any address involved. Geotagging attaches location metadata (usually coordinates from geolocation) to something else, like a photo or a social media post. A typical flow uses all three: your phone geolocates itself, reverse-geocodes the coordinates into a readable address for display, and geotags the photo you just took. Keeping the terms straight matters when you choose tools, because a geocoding API will not tell you where a phone is, and a geolocation API will not parse an address. When in doubt, test with your ugliest real addresses β the tidy ones always work.
Try it
Run an address through the reverse geocoder, look up coordinates from an address, or encode any location with the Plus Code converter.
Frequently asked questions
Why do different geocoders return different coordinates for the same address?
They use different reference datasets, different parsing and scoring, and different accuracy levels (rooftop vs interpolated). For critical addresses, compare two services and verify against ground truth β disagreement usually means at least one of them interpolated.
What is a rooftop geocoder?
A geocoder with building-footprint or parcel data that returns coordinates at the actual building rather than estimating along a street. It is the most accurate class of geocoding, typically within a few metres.
Is Nominatim free for commercial use?
Nominatim's public API is free within strict fair-use limits (about one request per second, no heavy bulk use). For commercial-scale geocoding you should self-host Nominatim, Photon or Pelias, or use a commercial provider.
How should I store geocoding results?
Store the coordinates plus the match confidence, accuracy level and the matched address text. That way you can later filter out low-confidence or city-level matches without re-geocoding everything.
Sources & data
Authoritative references used to research and verify this article: