GitHub

© OpenFreeMap © OpenMapTiles © OpenStreetMap contributors

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

1600 Pennsylvania Ave NW, Washington, DC geocodes to 38.89747, -77.03655. 大阪市中央区大阪城1-1 geocodes to 34.68737, 135.52586. Красная площадь, 3, Москва geocodes to 55.75470, 37.62144. 1 شارع الشيخ محمد بن راشد، دبي geocodes to 25.19721, 55.27416. 5 Av. Anatole France, Paris geocodes to 48.85826, 2.29450. 北京市东城区景山前街4号 geocodes to 39.91743, 116.39078. 불국로 385, 경주 geocodes to 35.79015, 129.33206. רחוב רוטשילד 16, תל אביב geocodes to 32.06280, 34.77093. Διονυσίου Αρεοπαγίτου 15, Αθήνα geocodes to 37.96847, 23.72848. Av. Atlântica 1702, Rio de Janeiro geocodes to -22.96701, -43.17919.

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

Get started

640 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 27.7 GB Pack, on 2 CPU cores with about 0.2 GB of memory of its own. The operating system's page cache holds the parts of the Pack that get used.

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.