Distance matrix
Paste a list of places and see the distance between every pair, by road and in a straight line, plus the travel time by car, by bike or on foot.
One per line, up to 50: a town, an address, or coordinates with a name (“Warehouse, 39.7392, -104.9903”).
Loading the map…
Routing: FOSSGIS OSRM and Valhalla · data © OpenStreetMap contributors Missing a road? Fix it on OpenStreetMap
Example Six US cities, by car. Change the list and press “Make the table”.
- Farthest pair
- 2,794mi
- New York, NY – Los Angeles, CA · by road
- Closest pair
- 373 mi
- Los Angeles, CA – Phoenix, AZ
- The road adds
- +16%
- on average over the straight line
- Places · Pairs
- 6 · 15
Driving distance, in mi. Each row is from that place; each column is to that place.
| Places | 1New York, NY | 2Los Angeles, CA | 3Chicago, IL | 4Houston, TX | 5Phoenix, AZ | 6Denver, CO |
|---|---|---|---|---|---|---|
| 1 New York, NY | — | 2,794 | 791 | 1,628 | 2,410 | 1,781 |
| 2 Los Angeles, CA | 2,794 | — | 2,018 | 1,548 | 373 | 1,016 |
| 3 Chicago, IL | 790 | 2,018 | — | 1,086 | 1,755 | 1,005 |
| 4 Houston, TX | 1,628 | 1,548 | 1,082 | — | 1,175 | 1,034 |
| 5 Phoenix, AZ | 2,410 | 373 | 1,754 | 1,175 | — | 821 |
| 6 Denver, CO | 1,781 | 1,017 | 1,006 | 1,035 | 821 | — |
Times assume clear roads at each road’s normal speed: they don’t include traffic, lights or stops. By car, the route may include ferries (to an island, for example): the crossing counts toward the distance and time.
Keep going with your places
More tools for comparing distances.
Save or share the table
How to use it
-
Paste your list
Type or paste up to 50 places, one per line: towns, addresses or coordinates. You can copy them straight from a spreadsheet column.
-
Make the table
Press “Make the table”. Places are looked up one at a time, and you’ll see which ones weren’t found so you can write them another way.
-
Pick what to see and download it
Switch between road, straight line and time, in miles or kilometers. Download the table as CSV, or every pair as a list.
What it’s for
-
Choosing where to meet
Compare how far each person would travel to several possible places before you decide.
-
Deliveries and sales calls
See at a glance which customers, stores or warehouses are close to each other.
-
Mileage and expenses
Get the miles between offices or job sites for mileage reimbursement.
-
Trips and school
Build a mileage chart for a road trip, or one of state capitals for a class.
How it’s calculated
Each place is looked up with Photon (OpenStreetMap data), keeping the result that best matches what you wrote. Coordinates are read as they are.
The straight-line distance is the geodesic, the shortest path on the WGS84 ellipsoid, calculated with GeographicLib. Road distance and time come from OSRM, on the OpenStreetMap road network, running on FOSSGIS’s public server, in a single request for the whole table.
By road, going and coming back may not be the same distance: a one-way street or a freeway exit changes the path. That’s why the table has one row for each origin and one column for each destination.
How many distances you get
n places → n × (n − 1) ÷ 2 pairs
With 6 places there are 15 pairs; with 50, 1,225. By road, both directions of each pair are calculated: 2,450 distances with 50 places.
Straight line vs. road
The road is always longer than the straight line, and by how much depends on the terrain: in the example, it’s 373 miles by road from Los Angeles to Phoenix and 2,794 from New York to Los Angeles. The table tells you how much longer the road is, on average, between your places.
By car, the route may include ferries where there’s no other way, and the crossing counts toward the distance and time. A place more than 30 km (19 miles) from any road shows as “no route”.
Limits
Up to 50 places per table. The address and routing services are free and public, so places are looked up one at a time, roughly one per second, and anything already looked up isn’t requested again while you stay on the page.
Frequently asked questions
How many places can I add?
Up to 50, which gives 1,225 pairs. If you paste more, the last ones are left out and you’ll get a notice.
Why isn’t A to B the same as B to A?
Because by road the way there and the way back can differ: one-way streets, freeway on- and off-ramps, or traffic circles. In a straight line, the distance is the same both ways.
What happens to places it can’t find?
They’re left out of the table and listed so you can fix them. Adding the state or the country usually does it (“Springfield, IL”), or you can write their coordinates.
Can I paste a spreadsheet column?
Yes: copy the column and paste it, and each cell becomes a place. For coordinates with a name, separate them with commas: “Warehouse, 39.7392, -104.9903”.
Does the time include traffic?
No: it’s the time on clear roads at each road’s normal speed. You can also work it out by bike or on foot.
How do I open the table in Excel?
Download it as CSV. “CSV (pairs)” has one row per pair with the straight line, the road distance and the time, ready to filter and sort.
Related tools
All toolsSources
- OSRM · Project OSRM, on FOSSGIS’s public server
- OpenStreetMap · OpenStreetMap contributors, ODbL
- Photon · Komoot, search with OpenStreetMap data
- GeographicLib · Charles Karney (distances on the ellipsoid)