Distance Between Two Places
Set two places, by search, GPS, coordinates or a map click, to get the straight-line distance in miles, kilometers and nautical miles, the direction, and how much higher one is.
Or click the map to place point
Loading map…
Drag a numbered pin to fine-tune it. Map: © OpenStreetMap contributors.
Straight-line distance
Set both places. The distance appears here and the line on the map.
—mi
km · nmi
By Ankit Kumar · Updated
What your result means
- Distance
- The great-circle distance over the Earth's surface: the shortest possible path, ignoring roads and terrain. Shown in statute miles, kilometers and nautical miles.
- Bearing
- The direction you would set off in, in degrees clockwise from true north and as a 16-point compass direction. "Back" is the bearing from the second place to the first.
- Elevation and difference
- Ground height at each point, from USGS 3DEP in the US and Terrain Tiles elsewhere, and how much higher one end is. The distance itself is measured at sea level; the height difference adds almost nothing to it (see limitations).
- Average grade
- The elevation difference divided by the distance, as a percent. Real routes climb and drop along the way, so use the elevation profile for a route's total climb.
- Midpoint
- The point halfway along the line. The link opens the halfway tool with nearby towns and places to meet.
How the distance is calculated: the haversine formula
With latitudes φ₁, φ₂ and longitudes λ₁, λ₂ in radians, and Earth's mean radius R = 6,371.0088 km (3,958.76 mi):
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
d = 2R · asin(√a)
The initial bearing θ, from north toward east:
θ = atan2(sin Δλ · cos φ₂, cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ)
- Each place comes from a search (OpenStreetMap Nominatim, then the US Census geocoder for US street addresses), your GPS, typed coordinates or a map click.
- The distance, bearing and midpoint are calculated in your browser. Miles = km ÷ 1.609344; nautical miles = km ÷ 1.852.
- Our server looks up the ground elevation at both points.
- The page address keeps both points, so a shared link opens the same result.
Worked check, Denver to Salt Lake City: Δφ = 1.0216°, Δλ = -6.9063°, which gives d = 596.9 km = 370.9 mi, and θ = 283.2° (WNW).
Worked examples: distances between US cities
From the downtown coordinates and USGS downtown elevations on each city's page, calculated with the same code as the tool. Click a pair to open it.
| From → to | Miles | Km | Nmi | Bearing | Elevations (ft) |
|---|---|---|---|---|---|
| Denver, CO → Salt Lake City, UT | 371 | 597 | 322 | 283° WNW | 5,276 → 4,264 (−1,012) |
| Phoenix, AZ → Las Vegas, NV | 256 | 412 | 223 | 318° NW | 1,088 → 1,996 (+908) |
| Boston, MA → Philadelphia, PA | 271 | 435 | 235 | 233° SW | 48 → 35 (−13) |
| Atlanta, GA → Nashville, TN | 215 | 346 | 187 | 322° NW | 1,050 → 555 (−495) |
| Albuquerque, NM → Santa Fe, NM | 58 | 93 | 50 | 44° NE | 4,955 → 6,997 (+2,042) |
| Denver, CO → Boston, MA | 1,765 | 2,841 | 1,534 | 73° ENE | 5,276 → 48 (−5,228) |
| Portland, OR → Bend, OR | 121 | 195 | 105 | 146° SE | 32 → 3,625 (+3,593) |
| Anchorage, AK → Honolulu, HI | 2,784 | 4,481 | 2,419 | 192° SSW | 104 → 19 (−85) |
The pairs show why elevation is worth checking next to distance. Albuquerque and Santa Fe are only 58 miles apart, but Santa Fe is 2,042 ft higher: an average grade of 0.7% over the straight line. Boston and Philadelphia, 271 miles apart, are both within 48 ft of sea level.
Distance as the crow flies vs driving distance
The straight line is the shortest possible distance, so it is always the lower bound for any trip. Roads add distance in proportion to how indirect the network is: grids in flat cities add little, and mountains, coastlines, lakes and rivers add a lot. The straight line is the right number for flight planning, radio and signal range, delivery radii, "how far away is that storm" and comparing how close places are.
This tool doesn't give driving distance or driving time. We checked the free routing services before building it: the public OSRM demo server is for non-commercial use only, and the free plans of openrouteservice and GraphHopper also exclude commercial use. Because this site carries ads, it doesn't use them. The result links to Google Maps directions for the drive.
| Unit | Definition | Used for |
|---|---|---|
| Statute mile (mi) | 1.609344 km (5,280 ft) | US road signs, everyday distance |
| Kilometer (km) | 1,000 m (0.6214 mi) | Most of the world, science |
| Nautical mile (nmi) | 1.852 km (1.1508 mi) | Sea and air navigation; about one minute of latitude |
Definitions: NIST Special Publication 811, Appendix B.
Accuracy and limitations
- Round Earth. Haversine assumes a sphere. On the WGS 84 ellipsoid, distances differ by up to about 0.5%; for a precise survey-grade figure, use a geodesic (Vincenty or Karney) calculator.
- Sea-level distance. The line is measured along the surface at sea level. Height barely changes it: at 5,276 ft, Denver is 0.025% farther from Earth's center, which adds that fraction to a distance.
- Where a city "is". A city search returns OpenStreetMap's point for it, usually downtown. Distances between city centers can differ by several miles from the distance between two specific addresses.
- Elevation of the ground. Elevations are bare-earth ground heights at the two points, not building floors or the height of a summit you did not click exactly.
Related tools
To find a meeting point for two to five people, with nearby towns and places to meet, usehalfway between two places. To compare boiling point, pressure and oxygen at two places, try compare elevations.
- What is my address
- What country am I in
- What state am I in
- What county am I in
- What city am I in
- What ZIP code am I in
- What time zone am I in
- My latitude & longitude
- Find location by lat/long
- What school district am I in
- What congressional district am I in
- What township am I in
- Halfway between two places
- Compare elevations
- Elevation profile
- Radius map tool
Frequently asked questions
How do I find the distance between two places?
Set the first place and the second, by typing a city, an address or coordinates, using your location, or clicking the map. The straight-line distance appears in miles, kilometers and nautical miles, with the compass direction and the elevation of both places.
What does "as the crow flies" mean?
The shortest distance between two points over the Earth's surface, ignoring roads, terrain and obstacles. On a globe it follows a great circle, which on a flat map often looks curved. It is also called straight-line or great-circle distance.
What does 2 miles as the crow flies mean?
That a straight line between the two points is 2 miles long. The walk or drive is longer wherever streets, rivers or hills keep you from going directly.
Can Google Maps show distance as the crow flies?
Yes, with "Measure distance": right-click (or long-press on a phone) the start and choose Measure distance, then click the end. This tool gives the same kind of straight line plus the bearing and the elevation of both ends.
How far is it from Denver to Salt Lake City?
371 miles (597 km) in a straight line between the downtowns, heading west-northwest from Denver. Salt Lake City is 1,012 ft lower.
How far is Phoenix from Las Vegas?
256 miles (412 km) as the crow flies, heading northwest from Phoenix. Las Vegas sits 908 ft higher than downtown Phoenix.
What is the difference between miles, kilometers and nautical miles?
A statute mile is exactly 1.609344 km and a nautical mile is exactly 1.852 km (about 1.15 miles). Nautical miles are used at sea and in aviation because one nautical mile is roughly one minute of latitude.
What is the bearing?
The compass direction you would start out in, measured clockwise from true north (0° north, 90° east, 180° south, 270° west). On a long great-circle route the direction changes along the way, so the tool also gives the bearing from the second place back to the first, which is not simply the reverse.
Why is the straight line curved on the map?
Web maps use the Mercator projection, which stretches areas far from the equator. The shortest path on the globe bends toward the pole on such a map. Over short distances the line looks straight.
Does the tool give driving distance?
No. Driving distance needs a routing service, and the free ones we checked do not allow use on a commercial, ad-supported site. The result links to Google Maps directions for the drive.
How accurate is the distance?
The haversine formula assumes a round Earth with a radius of 3,958.8 miles. The real Earth is slightly flattened, so the true distance can differ by up to about 0.5%: about 5 miles in 1,000. For most planning that is well below the uncertainty in where exactly each place "is".
Why does the elevation difference matter?
A big rise changes how hard a hike or bike ride is, how water boils and how you breathe. Denver is 5,228 ft higher than Boston; the compare link in the result shows what that does to boiling point, air pressure and oxygen per breath.
Can I measure the distance from my current location?
Yes. Tap "Use my location" for the first place, allow location access, and set the second place. The result uses your device's GPS position.
Sources
- IUGG mean Earth radius (Moritz, Geodetic Reference System 1980) — the 6,371.0088 km radius used in the haversine formula
- NIST Special Publication 811, Appendix B — exact definitions of the mile (1.609344 km) and the nautical mile (1.852 km)
- OpenStreetMap Nominatim — place and address search (© OpenStreetMap contributors, ODbL)
- U.S. Census Bureau Geocoder — US street addresses that OpenStreetMap does not find
- USGS Elevation Point Query Service — elevation of US points (3D Elevation Program), and the downtown elevations in the examples
- Terrain Tiles on AWS (Mapzen) — elevation outside the US
- Google Maps URLs — format of the driving directions link
- OpenStreetMap — map tiles (© OpenStreetMap contributors)
How each number is produced: methodology and data sources.