GitHub

© OpenFreeMap © OpenMapTiles © OpenStreetMap contributors

OpenGeocode: free, open-source, self-hosted geocoding

1600 Pennsylvania Ave NW, Washington geocodes to 38.89747, -77.03655. 名古屋城, 名古屋市 geocodes to 35.18532, 136.89918. Красная площадь, Москва geocodes to 55.75276, 37.62358. इंडिया गेट, नई दिल्ली geocodes to 28.61293, 77.22949. 5 Av. Anatole France, Paris geocodes to 48.85882, 2.29460. 故宫博物院, 北京 geocodes to 39.91743, 116.39078. قلعة صلاح الدين, القاهرة geocodes to 30.02983, 31.26147. 불국사, 경주 geocodes to 35.78909, 129.33182. הכותל המערבי, ירושלים geocodes to 31.77640, 35.23308. Cristo Redentor, Rio de Janeiro geocodes to -22.95192, -43.21046.

Fast, lightweight, self-hosted geocoding engine in pure Rust.

Get started

630 million addresses in a single file.

Forward, reverse and batch geocoding built from OpenStreetMap and OpenAddresses, served from your own hardware.

  • Self-hosted

    og runs on your own hardware. No address leaves your network, and there is no per‑lookup fee.

  • Fast

    0.72 ms a query and 14,087 queries a second on the Netherlands: 6× Photon and Pelias.

  • Lightweight

    One binary, one file, no database. The whole Netherlands fits in 337 MB.

Benchmarks

Paid-API accuracy. None of the weight.

On real web addresses, og puts more answers in the right city than TomTom or OpenCage, and trails TomTom by 1.4 points at street level. Against open-source engines it isn't close: the whole Netherlands on 1 vCPU and 1 GiB, at 0.72 ms a query and 6× the throughput of Photon and Pelias.

Read the full benchmarks →

Geocoding real web addresses

First answer within 20 km, % of queries (higher is better)

GeocoderBarGH4GH6
Google Maps98.6%88.3%
open-geocode93.9%78.0%
TomTom91.8%79.4%
OpenCage90.2%68.2%
Pelias85.9%67.8%
Photon84.9%62.8%
Nominatim66.6%55.6%

MESSY STREETS · 959 web addresses · other rows from the paper · og on its Planet Packmethod

From an extract to answers in one binary.

$ cargo install open-geocode --features tui
og — ~/packs — 80×2401 / 05

Compare

No API bills, no database, no cluster to run.

Commercial APIs are quick to start with, but bill every lookup and see every address.

Open-source geocoders keep the data in-house, but need a database or search cluster. og keeps it in-house and runs from one file.

FeatureogCommercialOpen source
Self-hostedAddresses stay on your networkYesNoYes
No usage feesNo quotas or rate limitsYesNoYes
InfrastructureWhat you run and maintainYesOne binary, one fileYesNone, it's hostedNoDatabase + search cluster
Batch geocodingCSV in, coordinates outYesFree, unlimitedYesFree tier, then per addressNoNo batch endpoint
Open sourceMIT licensed, open dataYesNoYes

Open source: Nominatim, Pelias and Photon. Commercial: Google, HERE, Mapbox and others.

FAQ

Questions, answered.

Common questions about hosting OpenGeocode, what it costs, and how accurate it is.

Read the documentation
How do I use OpenGeocode?

Build a Pack with og build, then og serve it. See the quickstart.

What hardware do I need to host it?

Very little. This page's search serves the whole planet, a 26.3 GB Pack, from a 4 vCPU VM with 7.6 GB of RAM, using about 0.5 GB of memory.

How much does OpenGeocode cost?

Nothing. No API key, quota or per-lookup fee; you only pay for your machine.

Does it work offline?

Yes. It only needs a connection to download data when building a Pack.

Can I geocode a whole CSV?

Yes, with open-geocode geocode batch. See batch geocoding.

How accurate is it?

It leads the open-source geocoders on the MESSY STREETS benchmark. See the benchmarks.

What about data and privacy?

It runs on your hardware, so no address leaves your network.

Is OpenGeocode open source?

Yes, MIT-licensed, on GitHub.