How to Geocode Addresses in Google Sheets

Updated July 7, 2026 · Geloky team

Google Sheets feels like it should geocode addresses natively — it's Google, after all — but there is no =GEOCODE() function. You have two real options: a small Apps Script, or exporting to CSV and batch geocoding. Which one to use depends on how many rows you have.

Option 1 — Apps Script custom function (good for small, live sheets)

Extensions → Apps Script, paste, save, then use =GEOCODE(A2) in the sheet:

function GEOCODE(address) {
  if (!address) return null;
  Utilities.sleep(500); // be gentle with quotas
  var result = Maps.newGeocoder().geocode(address);
  if (result.status !== 'OK' || !result.results.length) return 'NOT_FOUND';
  var loc = result.results[0].geometry.location;
  return [[loc.lat, loc.lng]];
}

The catches, learned the hard way:

  • Daily quotas. The Apps Script Maps service allows on the order of a thousand geocodes per day on consumer accounts (Google adjusts quotas — check current docs). A 3,000-row sheet will die mid-column.
  • Recalculation re-fires requests. Custom functions re-run when the sheet recalculates, silently burning quota. The usual fix: paste the results as values immediately.
  • Speed. One request per row, sequentially. Hundreds of rows take minutes.
  • Terms. Results from Google's geocoder are subject to Google Maps terms — if you plan to export the data elsewhere, read them first.

Option 2 — Export, batch geocode, import back (good for whole sheets)

  1. File → Download → CSV.
  2. Upload to the batch geocoding tool, map the address columns, preview the first rows free, convert. 100 records/day are free, then $1 per 1,000.
  3. Import the result back: File → Import → Upload → Replace/Insert sheet. Your original columns come back with latitude/longitude appended.

Two minutes of export/import beats an afternoon of quota babysitting once you're past a few hundred rows — and there are no per-account daily ceilings to plan around.

Decision rule

  • Under ~200 rows, needs to stay live in the sheet: Apps Script.
  • Hundreds to hundreds of thousands of rows, one-off or periodic: export → batch geocode → import.
  • Continuous pipeline feeding other systems: a geocoding REST API called from your backend, not from the spreadsheet.

Geocode your spreadsheet in minutes

Upload a CSV or Excel file to the Geloky batch geocoding tool — every row converted to latitude/longitude, first 100 records per day free, no code needed.

Try batch geocoding free
We use cookies for various purposes including analytics and personalized marketing. By continuing to use the service, you agree to our use of cookies as described in the Cookie Policy.   I Agree