Google Distance Matrix API alternatives: an honest 2026 comparison
Compare Google Distance Matrix alternatives: Mapbox, HERE, TomTom, openrouteservice, self-hosting and Wayline on price, free tier, traffic and coverage.
By Wayline Engineering · · Updated · 4 min read
The Google Distance Matrix API is the default choice for "how far and how long between these points?" It is also, for many teams, the largest line on the maps bill. A distance matrix is billed per element (one origin–destination pair), so a modest 25 × 25 matrix is 625 billable events. Run that a few hundred times a day and costs add up quickly.
This guide compares the realistic alternatives on the things that actually decide a migration: price per element, free tier, whether you need live traffic, coverage, and how much code you have to change.
Quick answer
- Need live, traffic-aware ETAs everywhere in the world? Stay on Google, or evaluate HERE and TomTom, which also license traffic data.
- Need road distance and typical drive time at the lowest cost? Use an OpenStreetMap-based API (Mapbox, openrouteservice, Wayline) or self-host an open-source routing engine.
- Want to switch without rewriting your parser? Use an endpoint that returns Google's response format, such as Wayline's Google-compatible Distance Matrix.
Price per 1,000 matrix elements
| Provider | Free usage | First paid tier | Traffic-aware option |
|---|---|---|---|
| Google Compute Route Matrix (Essentials) | 10,000 / month | $5.00 | Pro tier, $10.00 |
| Google Distance Matrix (legacy) | 10,000 / month | $5.00 | Advanced, $10.00 |
| Mapbox Matrix API | 100,000 / month | $2.00 | Traffic profile available |
| Wayline Distance Matrix | Free units on signup | See pricing | No |
Sources: Google Maps Platform pricing, Mapbox pricing. HERE and TomTom publish usage-based plans too; their price pages change often and depend on contract, so check them directly.
The alternatives, one by one
1. Mapbox Matrix API
A mature, well-documented API on OpenStreetMap-derived data with a generous free tier. Matrix sizes are capped per request (check the current limits for your profile), and the response format differs from Google's, so expect to rewrite parsing code. Good fit if you already use Mapbox maps.
2. HERE Routing / Matrix Routing
HERE has strong data in Europe and North America and offers traffic. Pricing and quotas depend on plan. Best when you need traffic and enterprise procurement terms.
3. TomTom Matrix Routing
TomTom's own map and traffic data, with synchronous and asynchronous matrix options. Worth a look for fleet workloads that need historical and live traffic.
4. openrouteservice
An open-source routing service from HeiGIT, built on OpenStreetMap. The hosted API has a free plan with daily quotas, and you can self-host it. A good choice for non-commercial projects, research and prototypes; plan capacity carefully for production.
5. Self-hosting an open-source engine
Open-source routing engines on OpenStreetMap data are extremely fast — table queries for hundreds of points return in milliseconds — and you pay only for servers. The catch is operations: building datasets, scheduling map updates, sizing memory, high availability, authentication, rate limiting and billing are all yours.
6. Wayline
Wayline runs its own routing engine on OpenStreetMap data for you and adds what production needs: API keys with origin and IP restrictions, rate limits, usage metering, dashboards and billing in USD. Every response includes a map_version so results are reproducible. Wayline does not offer live traffic, and coverage is region-based — check the coverage page before you migrate.
7. Keep Google, but spend less
Sometimes the right move is to stay and optimize: cache distances between fixed points, pre-filter candidates with straight-line distance before running a matrix, and use traffic-aware SKUs only where live traffic changes the decision.
How to choose
- Does live traffic change your decision? Same-hour dispatch in dense cities often does. Delivery fees, mileage reimbursement, service-area checks and next-day planning usually don't.
- What is your element volume? Multiply origins × destinations × calls per month. Above a few hundred thousand elements, price per element dominates.
- Is your region well mapped in OpenStreetMap? Most cities are excellent; check rural areas you care about.
- How much code can you change? A Google-format endpoint makes the switch a base-URL change.
Migrating without a rewrite
If your code already parses Google's rows[].elements[] response, point it at a compatible endpoint and keep the parser:
curl "https://api.wayline.cloud/maps/api/distancematrix/json?origins=37.788,-122.4075&destinations=37.8044,-122.2712&key=$WAYLINE_API_KEY"Then run both providers side by side on a sample of real trips and compare distances before you cut over. The migration guide covers parameters that map one-to-one and the few that don't.
FAQ
Is OpenStreetMap routing accurate enough for business use? For distance, usually yes — road geometry in OSM is excellent in most cities. Duration without traffic is a typical free-flow estimate; for rush-hour ETAs you need traffic data.
Can I cache Distance Matrix results?
Provider terms differ, so read each one. Google's Maps Platform terms limit how long most content may be cached. Wayline's caching guide recommends caching distances between fixed points in your own application, keyed by map_version.
What is the cheapest Distance Matrix API? Self-hosting has the lowest marginal cost but the highest operating cost. Among hosted APIs, OSM-based providers are typically several times cheaper per element than traffic-aware ones.