Skip to main content

What is Geocoding? How Location Search Works

Geocoding converts addresses to GPS coordinates, powering every store locator search. Learn how it works, accuracy levels, and why it matters for your business.

Geocoding converts an address or place name into coordinates (latitude and longitude). A store locator needs it twice: to place each location on the map, and to turn what a visitor types, such as "90210", into a point it can measure distance from.

Related concepts: What is a store locator? | What is geofencing?

The short answer

  • Geocoding turns an address into coordinates. Reverse geocoding turns coordinates into an address.
  • Accuracy varies by address and country. Check the pin for each location, and add coordinates by hand where an address does not geocode well.
  • Complete addresses (street, city, region, postal code, country) geocode best.
  • You pay for it if you call a geocoding API yourself. With a store locator, the platform geocodes when you add or import locations. The map still runs on a provider: with StoreRocket, after the free trial it runs on your own Google Maps or Mapbox key, and that provider bills its usage to you.

Geocoding Definition

Geocoding is the process of converting human-readable addresses or place names into geographic coordinates (latitude and longitude).

Example:

  • Input: "1600 Pennsylvania Avenue, Washington, DC"
  • Output: 38.8977° N, 77.0365° W

The reverse process, converting coordinates to addresses, is called reverse geocoding.

Why Geocoding Matters

For Store Locators

When a customer searches "stores near Chicago":

  1. Geocoding converts "Chicago" to coordinates (41.8781° N, 87.6298° W)
  2. The system calculates distance from those coordinates to each store
  3. Results show stores nearest to that point

Without geocoding, the system would have no way to understand where "Chicago" is in relation to your stores.

For Location Data

When you add a store at "123 Main Street, New York":

  1. Geocoding converts that address to coordinates
  2. Those coordinates place the store correctly on the map
  3. Distance calculations become possible

The Coordinate System

Geographic coordinates use:

  • Latitude: North/South position (-90° to +90°)
  • Longitude: East/West position (-180° to +180°)

Together, they pinpoint any location on Earth with precision.


How Geocoding Works

The Geocoding Process

Step 1: Parse the Input

The system breaks down the address:

  • Street number: 123
  • Street name: Main Street
  • City: New York
  • State: NY
  • Country: USA (assumed or specified)

Step 2: Normalize and Standardize

Address variations are handled:

  • "St" → "Street"
  • "NYC" → "New York"
  • Common misspellings corrected

Step 3: Search Address Database

The geocoder searches its database:

  • Street-level databases
  • Building databases
  • Place name databases
  • Postal code databases

Step 4: Return Coordinates

The result includes:

  • Latitude
  • Longitude
  • Confidence score
  • Matched address (standardized)
  • Additional metadata

Geocoding Accuracy Levels

Level Precision Example Use
Rooftop Exact building Store location
Point address Street number Customer search
Street Street centerline Approximate
Postal code Area center Low precision
City City center Broad search

For store locations, you want rooftop or point-address accuracy where it is available.


Types of Geocoding

Forward Geocoding

Address → Coordinates

  • "123 Main St, NYC" → 40.7484° N, 73.9857° W (illustrative coordinates)
  • Most common for store locators
  • Used when customers search or when adding store data

Reverse Geocoding

Coordinates → Address

  • 40.7484° N, 73.9857° W → "123 Main Street, New York, NY"
  • Used to show a readable place name for a GPS position
  • For example, naming the area after a visitor taps "use my location"

Batch Geocoding

Many addresses at once

  • Process thousands of addresses in bulk
  • Used when importing store data
  • More efficient than one-by-one

Geocoding Services

Google Maps Geocoding API

Widely used:

  • Excellent global coverage
  • High accuracy
  • Extensive address database
  • Part of Google Cloud Platform

Pricing (Google's pricing page):

  • First 10,000 requests per month free
  • $5 per 1,000 in the first paid band, then $4, $3, $1.50, and $0.38 per 1,000 in higher-volume bands

Want to explore the free tier? Read our guide on how to use the Google Maps API free.

Mapbox Geocoding API

Strong alternative:

  • Good accuracy
  • Beautiful map integration
  • Competitive pricing
  • Open data sources

Pricing (Mapbox's pricing page):

  • Temporary geocoding: first 100,000 requests per month free, then $0.75 per 1,000
  • Permanent geocoding: starts at $5 per 1,000, with no free allowance

Learn more: How to use Mapbox API free and our Google Maps vs Mapbox comparison.

Other Options

  • HERE Geocoding: Enterprise-focused
  • OpenCage: Open data based
  • Nominatim: Free, open-source (OpenStreetMap)
  • Pelias: Self-hostable

Geocoding in Store Locators

Modern store locator platforms handle geocoding for you:

StoreRocket:

  • Add a location in the dashboard by typing the address with suggestions, then drag the pin to fine-tune it or type exact coordinates
  • Imports place each address on the map for you, and rows that already have latitude and longitude keep them
  • Visitors search by address, city or postcode and get suggestions as they type
  • Google Maps or Mapbox: during the free trial StoreRocket supplies the map, and after you subscribe you connect your own key

You do not need to run a geocoding service yourself.


Geocoding Challenges

Address Ambiguity

Problem: Same address in different cities.

"123 Main Street" exists in thousands of cities. Without city/state context, geocoding fails.

Solution: Always capture complete addresses. Require city/state/zip minimum.

Address Variations

Problem: Many ways to write the same address.

  • "123 Main St"
  • "123 Main Street"
  • "123 Main St."
  • "123 Main Street, Apt 4B"

Solution: Modern geocoders handle variations well. Normalize before storing.

Non-Standard Addresses

Problem: Some locations don't have standard addresses.

  • Rural areas
  • New developments
  • Industrial parks
  • Some countries' addressing systems

Solution: Use coordinate input for locations without standard addresses.

Moving Locations

Problem: Businesses move but coordinates don't update.

Solution: Re-geocode when addresses change. Verify coordinates periodically.

International Addresses

Problem: Address formats vary globally.

  • UK: Different postal code format
  • Japan: Different address structure
  • UAE: Often no street addresses

Solution: Use geocoders with strong international coverage. Accept local formats.


Geocoding in Store Locator Implementation

When You Add Stores

Process:

  1. You enter store address
  2. Geocoder converts to coordinates
  3. Coordinates stored in database
  4. Store appears correctly on map

With StoreRocket: Enter an address and the pin is placed for you. You can drag it or type exact coordinates to correct it.

Process:

  1. Customer enters "90210"
  2. Geocoder converts to coordinates (34.0901° N, 118.4065° W)
  3. System calculates distance to each store
  4. Results sorted by proximity

Speed matters: a slow search feels broken, so the geocoder behind a locator needs to answer quickly.

Accuracy Considerations

For stores:

  • Use complete, verified addresses
  • Confirm pin placement on map
  • Manually adjust if needed

For searches:

  • Accept partial input (zip code alone works)
  • Show "searching near [location]" confirmation
  • Allow refinement if wrong

Distance Calculation

Once you have coordinates, distance calculation uses the Haversine formula:

The Haversine Formula

Calculates distance between two points on a sphere (Earth):

 1a = sin²(Δlat/2) + cos(lat1) × cos(lat2) × sin²(Δlong/2)
 2c = 2 × atan2(√a, √(1−a))
 3distance = R × c

Where:

  • R = Earth's radius (3,959 miles or 6,371 km)
  • lat1, lat2 = latitudes in radians
  • Δlat, Δlong = differences in coordinates

In Practice

Store locator platforms handle this automatically. When you search, the system:

  1. Gets your search coordinates (geocoding)
  2. Calculates distance to each store (Haversine)
  3. Sorts results by distance
  4. Returns the nearest X stores

Geocoding Best Practices

For Store Data

Capture complete addresses:

  • Street number and name
  • City
  • State/Province
  • Postal code
  • Country (for international)

Verify coordinates:

  • Check pin placement after geocoding
  • Manual correction if needed
  • Re-verify periodically

Standardize format:

  • Consistent address formatting
  • No extra characters or line breaks
  • One address per field

Accept flexible input:

  • Zip code only
  • City only
  • Full address
  • GPS coordinates

Confirm the match:

  • "Showing results near [interpreted location]"
  • Option to search again if wrong

Handle failures gracefully:

  • "Location not found" message
  • Suggestions for correction
  • Default to broader search

Geocoding and Your Store Locator

Understanding geocoding helps you:

  • Know why complete addresses matter
  • Troubleshoot incorrect pin placement
  • Appreciate what happens behind "find a store"

But you don't need to implement geocoding yourself.

StoreRocket gives businesses with several locations a store locator for their own website: import your locations from a spreadsheet, match it to your brand and paste one embed code. Create your locator with a free trial, no credit card needed.

Create your locator →

Frequently Asked Questions

What is geocoding used for?

Geocoding converts addresses to coordinates, enabling:

  • Store locators
  • Delivery routing
  • Map applications
  • Location analytics
  • Geographic data visualization

Is geocoding the same as GPS?

No. GPS (Global Positioning System) determines your current location using satellites. Geocoding converts addresses to coordinates. They're related but different technologies.

Why does geocoding sometimes fail?

Common reasons:

  • Incomplete address
  • Misspelled address
  • New development not in database
  • Non-standard addressing
  • International format issues

How accurate is geocoding?

Accuracy depends on the geocoder and the address. Established urban addresses usually match closely, while rural areas, new developments and some countries' addressing systems can be less precise. Check the pin for important locations.

Do I need to understand geocoding to use a store locator?

No. A store locator platform like StoreRocket places your addresses on the map when you add or import them, and handles visitor searches. You can still adjust any pin.


Technical questions about geocoding? Contact us.


Related: What is geofencing? | Google Maps vs Mapbox | How to add a store locator to your website | Store locator SEO guide

Put a store locator on your site today

Import your locations, make the locator match your website, and add it to a page the way you would add a video. No developer required.

Create your locator

7 days free · No card · No automatic charge · see a live locator first

Related Articles