Some of the most useful maps I have ever produced started with a humble spreadsheet. A health authority once handed me a file of twelve thousand patient visits, each with a street address and nothing else. No coordinates, no map, just a long column of text. Two days later they were looking at the first spatial picture of how far their patients traveled and which neighborhoods were underserved. The bridge between the spreadsheet and the map was a single process: geocoding.
Geocoding is one of those techniques that looks like magic from the outside and turns out to be quite logical on the inside. It’s also full of subtle traps, such as quality, privacy, licenses and bias, that can quietly ruin an analysis. In this guide I’ll explain how geocoding works, which methods and services exist, how to prepare your addresses, how to measure the quality of the result, and how to do it responsibly.

What Is Geocoding?
Geocoding is the process of converting a description of a place, usually an address, a postal code or a place name, into geographic coordinates, so that it can be placed on a map.
- Forward geocoding: from address to coordinates. “10 Downing Street, London” becomes a latitude and longitude.
- Reverse geocoding: from coordinates to the nearest address or place name. A GPS point becomes “Rue de Rivoli, Paris”.
- Batch geocoding: doing it for thousands or millions of records at once.
It’s the key that unlocks everything else. Once your records have coordinates, you can map them, count them by district, measure distances, analyze patterns and combine them with any other layer, as described in Spatial Analysis in GIS: Complete Guide.
How Geocoding Works
Behind the scenes, a geocoder performs a sequence of steps.
- Parsing. The address text is split into components: number, street name, street type, unit, city, region, postal code, country. “Av. Victor Hugo, 25” must be understood as a street and a number.
- Standardization. Components are normalized: “St.” becomes “Street”, “Ave” becomes “Avenue”, abbreviations expanded, accents and case handled.
- Matching. The standardized address is compared with a reference dataset: a database of known addresses, streets or places. The geocoder looks for the best candidates and scores them.
- Locating. For the best match, the geocoder computes a position, using one of several methods described below.
- Returning. The result includes coordinates, a match score, a match type and often a formatted address.
The quality of the result depends on two things: how good your input addresses are, and how good the reference data is.
Location Methods: How Precise Is the Point?
Not all geocoded points are equal. The position can be derived in several ways, from the most precise to the least.
- Address point (rooftop): the reference data contains a point for each individual address, often at the building or entrance. The most accurate method, available where authorities or providers maintain address points.
- Parcel centroid: the center of the land parcel with that address. Good, but in large or irregular parcels the center may be far from the building.
- Street interpolation: the reference data has street segments with address ranges (for example, numbers 1 to 99 on the odd side). The geocoder estimates the position proportionally along the segment. A “25” in a range of 1 to 99 lands about a quarter of the way along. Usually accurate to a few tens of meters, but it can be off where numbering is irregular.
- Street centerline or street name: if the number is unknown, the point falls on the street, or at its middle.
- Postal code centroid: the center of the postal code area. Accuracy depends on the size of the area, from a few hundred meters in a city to many kilometers in rural districts.
- Locality or administrative centroid: the center of a city, municipality or region. Good only for coarse mapping.
Every geocoded point should come with an indication of which of these was used. Mixing rooftop points and city centroids in one map, without telling anyone, is a classic way to mislead.
Where Does the Reference Data Come From?
The reference data decides the quality, and it varies hugely around the world.
- National or local address databases: official sources are often the best. Several countries publish open national address databases, which are excellent for high-quality, free geocoding. National open data portals are the place to look, as described in Open Data Portals by Country.
- OpenStreetMap: a collaborative database with streets, many buildings and, in some places, address points. Quality varies widely by region.
- Commercial data providers: large companies maintain proprietary address and street data, and sell geocoding as a service.
- Your own data: a utility, a school district or a municipality may hold its own address layer, which you can use to build a custom locator.
Geocoding Services and Tools
There are many ways to geocode. Here are the main families.
Online geocoding services
- Nominatim: the open-source geocoder built on OpenStreetMap data. The public server has a strict usage policy: it is intended for light use, with limits on request rates, and heavy bulk geocoding should go through your own installation or a commercial service.
- Commercial services: Esri‘s World Geocoding Service (which consumes credits), Google, HERE, Mapbox, TomTom and others. They usually offer high coverage and accuracy, with pricing based on usage.
- Open and hybrid services: various providers built on OpenStreetMap and open data offer free tiers with limits.
- National geocoders: some governments provide their own free geocoding services based on their official address databases.
Desktop and software options
- ArcGIS Pro: build or use locators and run the Geocode Table tool, with online or custom locators.
- QGIS: there are plugins and Processing providers that call external geocoding services. Check the plugin repository for what is currently available, and see Best GIS Plugins for QGIS. For batch work, many people geocode with a script and then import the result.
- Spreadsheets and ETL tools: some can call geocoding APIs for small jobs.
Code
Python makes geocoding easy to automate. The geopy library wraps many services behind one interface.
from geopy.geocoders import Nominatim
from geopy.extra.rate_limiter import RateLimiter
import pandas as pd
# A descriptive user_agent is required by the Nominatim usage policy
geolocator = Nominatim(user_agent="my-geocoding-project")
geocode = RateLimiter(geolocator.geocode, min_delay_seconds=1)
df = pd.read_csv("addresses.csv") # a column named "address"
df["location"] = df["address"].apply(geocode)
df["lat"] = df["location"].apply(lambda loc: loc.latitude if loc else None)
df["lon"] = df["location"].apply(lambda loc: loc.longitude if loc else None)
df.to_csv("addresses_geocoded.csv", index=False)This example respects the public service’s rate limit by waiting a second between requests. For large jobs, don’t hammer public servers: use a commercial service, or install a geocoder yourself.
A word about terms of use
Geocoding services come with terms. Some forbid storing the results, or using them with maps from other providers. Some limit the number of requests. Some require attribution. Read the terms before you geocode a large dataset, especially if you plan to keep the coordinates in a database or publish a map.
Preparing Your Addresses: The Step That Decides Everything
I tell my students that 80 percent of geocoding quality is decided before you press the button. Garbage in, garbage out.
- Look at the data. Open the table and scan it. Are addresses in one column or split into parts? Are there typos, missing postal codes, nicknames, extra text such as “next to the pharmacy”?
- Split or combine fields consistently. Many tools work best with separate fields (street, city, postal code, country). Others accept a single string. Follow the tool’s recommendation.
- Standardize. Fix abbreviations, remove punctuation noise, trim spaces, and unify the language and the order of the elements.
- Include the country and city. An address without them is ambiguous: there are streets with the same name in many places.
- Handle special cases. Post office boxes can’t be geocoded to a street. Intersections (“Main St and 5th Ave”) need a tool that supports them. Rural routes and informal settlements may need other approaches.
- Remove duplicates. Geocoding the same address ten thousand times wastes time and money. Geocode unique addresses and join the results back.
- Keep a unique ID for each record, so you can match results to the original data.
- Keep the original text untouched in a separate column, so you can always check what was actually sent.
- Test with a sample. Geocode a hundred records, inspect the results, adjust, then run the full batch.
Measuring Quality: Never Trust a Geocode Blindly
Every geocoder returns indicators. Learn to read them.
- Match status: matched, tied (several equally good candidates) or unmatched.
- Match score: how closely the address matched the reference, usually from 0 to 100. A high score means the text matched well, not necessarily that the point is accurate.
- Match type or precision level: rooftop, interpolated, street, postal code, locality. This tells you how precise the location is.
- Matched address: the standardized address the geocoder believes it found. Compare it with your input to catch false matches.
The metrics to report
- Match rate: the share of records that were geocoded. A rate of 100 percent is suspicious, because it may include very imprecise matches.
- Precision breakdown: how many matched at rooftop, street, postal code level.
- Positional accuracy: if you have a reference sample, such as GPS points for a subset, measure the distance between the geocoded and true points.
Quality control steps
- Map the results and look for outliers, such as points in the sea, in other countries or far from the study area.
- Compare with a boundary. Check that each point falls inside the city or region stated in its address.
- Review low-score matches and ties by hand.
- Work on the unmatched. Many failures have simple causes, such as misspellings, missing numbers or new streets. Correct and re-run them.
- Decide a threshold. Define the minimum score and precision acceptable for your purpose, and treat the rest as unmatched.
- Document everything, in the spirit of Metadata in GIS: Why It Matters and How to Create It: the service, the date, the reference data version and the quality indicators.
Geocoding Errors and Biases
Geocoding isn’t neutral. Be aware of these problems.
- Urban-rural bias. Match rates and precision are usually much better in cities than in rural areas, where interpolation errors and missing addresses are common. If your unmatched records concentrate in certain areas, your analysis will be biased against them.
- Socioeconomic and informal settlements. Areas without formal addresses, or with newer streets, are underrepresented in reference data. People living there may disappear from your map.
- Interpolation errors. On long street segments, or where numbering is irregular, the point may be far from the real building.
- Wrong city, same street. A street name found in the wrong town, because the city was missing or misspelled.
- Ambiguous names. Many places share names. Use the country and region to disambiguate.
- Outdated reference data. New buildings and renamed streets are missing.
- Coordinate order and format. Latitude and longitude swapped, or coordinates in a different CRS from the one you assume. Most geocoders return WGS 84 latitude and longitude. See Coordinate Reference Systems (CRS) Explained Simply.
Privacy and Ethics: Addresses Are Personal Data
A home address is one of the most sensitive pieces of personal information there is. Geocoding turns it into a precise point on a map, which makes the privacy stakes even higher.
- Know the law. In many countries, addresses linked to individuals are protected personal data. Follow the rules that apply to you.
- Be careful with third-party services. Sending patient, customer or citizen addresses to an external online service means sharing that data with the provider. For sensitive data, use an offline or self-hosted geocoder.
- Minimize. Geocode only what you need, and don’t keep more detail than your analysis requires.
- Aggregate before publishing. Never publish a map of individual points that reveal where specific people live. Aggregate to areas, such as districts or grid cells, and suppress small counts.
- Control access to the geocoded data, and delete it when it is no longer needed.
- Think about harm. A point on a map can identify a victim, a witness or a vulnerable person.
Alternatives When Addresses Don’t Exist
Not every place has a street address system. Where addresses are unreliable, consider:
- Administrative geocoding: match on neighborhood, village or district names, using an authoritative gazetteer of place names.
- Place-name gazetteers: databases such as GeoNames, which link names to coordinates.
- Landmarks and descriptions: a structured description, with GPS collection where possible.
- Global grid codes: systems such as Plus Codes (the open location code) turn coordinates into short codes that can serve as addresses. Some proprietary systems exist as well, with their own licensing.
- Direct data collection: capture coordinates with a GPS or phone in the field. For field tools, see Best Free and Open-Source GIS Tools.
A Step-by-Step Workflow
- Define the purpose and the required precision. Is a postal-code level result acceptable, or do you need rooftop points?
- Choose the geocoder and check its terms, cost, coverage and privacy implications.
- Prepare and clean the addresses, keeping the originals and a unique ID.
- Test on a sample.
- Run the batch, respecting rate limits.
- Inspect the quality indicators, map the results and check the outliers.
- Fix and re-run unmatched or low-quality records.
- Import the coordinates into your GIS as points, defining the CRS correctly (usually EPSG:4326).
- Reproject to a suitable projected CRS before measuring distances or buffering.
- Document the method and the accuracy, and protect the data.
Final Thoughts
Geocoding is the quiet hero of countless maps. It makes the invisible visible: a list of addresses becomes a pattern. But the pattern is only as honest as the process that produced it. Every point carries an implicit claim about where something is, and every unmatched record is a story that didn’t make it onto the map.
Treat geocoding as a measurement, with a known precision, an error rate and a documented method. Look at the results with suspicion, repair what you can, and be clear about what remains uncertain. That discipline will make your maps trustworthy.
Where to go next: read Georeferencing a Scanned Map Step by Step for the other way of putting data in its place, and Network Analysis and Route Optimization to use your geocoded points for routing and accessibility.



