What is Geocoding? A Plain Explanation for Developers
Kees Van Den Broek, Founder

What is Geocoding? A Plain Explanation for Developers
Geocoding is the process of converting a description of a place, such as a street address or a postcode, into geographic coordinates: a latitude and a longitude. Once a location is expressed as a pair of numbers, software can measure distances between places, draw them on a map, and decide whether one place falls inside an area.
That is the whole idea. Everything below is detail about how it is done and where it goes wrong.
What is a geocode?
A geocode is the output: the coordinate pair that represents a place. In most APIs it arrives as two decimal numbers, for example 51.5014 and -0.1419 for Buckingham Palace. Some UK systems use eastings and northings on the British National Grid instead, which are metres from a fixed origin rather than degrees.
A geocode on its own is incomplete information. What matters just as much is what the coordinate refers to: the centre of a building, a point interpolated along a street, or the middle of a whole postcode area. A geocode without its precision is a number you cannot safely act on.
Forward geocoding vs reverse geocoding
- Forward geocoding, usually just called geocoding, goes from text to coordinates. Input: "10 Downing Street, London SW1A 2AA". Output: a latitude and longitude.
- Reverse geocoding goes from coordinates to text. Input: a latitude and longitude from a phone or a vehicle tracker. Output: the nearest or containing address.
Both are offered by the same services, and they fail in different ways. Forward geocoding fails on ambiguity, because many places share a name. Reverse geocoding fails on proximity, because a point in a street is close to several buildings and inside none of them.
What a geocoder actually does
A geocoder is not a lookup table. It works in stages:
- Parsing. Split the input string into components: building number, street, locality, postcode. This is harder than it sounds, because people write addresses in every possible order and abbreviate freely.
- Normalisation. Standardise those components. "St" becomes "Street", casing is fixed, the postcode is reformatted.
- Matching. Find candidates in the reference dataset. Matching is fuzzy by necessity, because the input is usually imperfect.
- Scoring. Rank candidates and pick one, with a confidence value and a precision level.
Steps three and four are where geocoders differ from one another. Two services given the same address and the same underlying data can disagree, because they score candidates differently.
How to geocode addresses in practice
For one address, call a geocoding API and read three fields: the coordinates, the precision, and the confidence. For a list of addresses, the process has an extra step that people frequently skip.
Clean before you geocode. A geocoder given rubbish will return a plausible-looking coordinate rather than an error, and a plausible-looking wrong answer is much worse than a failure. Validate and normalise the addresses first, and the match rate goes up while the silent errors go down.
Do not throw away the unmatched rows. They are usually new-build properties, addresses with an unusual sub-premise, or genuine data-entry errors that are worth fixing at source.
Watch the precision distribution, not just the match rate. A batch that is "98% matched" but mostly at postcode-centroid precision has not given you what you needed if you were planning to route vehicles with it.
Geocoding and postcodes in the UK
In the UK, postcodes do a lot of the work that full addresses do elsewhere. A postcode unit covers a small number of adjacent delivery points, so geocoding the postcode alone gives a usable location for analysis, catchment mapping and store locators, and postcode-level coordinates are available as open data.
Address-level geocodes, pointing at an individual building, come from address datasets: licensed ones such as Ordnance Survey AddressBase, or OpenStreetMap, which is open but varies in completeness. If you only need to know roughly where a customer is, the postcode is enough and much cheaper. If something has to arrive at a door, it is not.
Frequently asked questions
What is geocoding in simple terms?
It is turning an address into a pair of coordinates so that a computer can place it on a map or measure distances to it.
What is the difference between geocoding and reverse geocoding?
Geocoding converts an address into coordinates. Reverse geocoding converts coordinates into the nearest or containing address. They are opposite directions of the same translation.
What is a geocoder?
A geocoder is the service or software that performs the conversion. It parses the address, normalises the components, matches them against a reference dataset, and returns the best-scoring coordinate with a precision level.
How accurate is geocoding?
It depends on the precision level returned. Rooftop or premise-level geocodes point at the building. Street-level geocodes are interpolated from house-number ranges and are typically within a few properties. Centroid geocodes point at the middle of a postcode or area and can be considerably off for any individual address.
Is geocoding the same as address validation?
No. Validation checks that an address exists and is internally consistent. Geocoding gives that address a position on the earth. They are usually used together, and validating first improves geocoding results.
Next steps
If you have the concept and now want the API, geocoding and reverse geocoding in practice covers endpoints, accuracy levels and the limits of free tiers. If you would rather see the whole field first, the UK postcode API guide covers the rest of it.
