Measurement tool
Distance between two places
Great-circle distance, bearing, and map line between two points.
Short answer
- Boston to Sacramento
- 2,625mi
- Start heading
- 282°
Worked example: Boston to Sacramento
The Massachusetts capitol point is 42.358, -71.064 and the California capitol point is 38.577, -121.494. The haversine formula on a sphere of radius 6,371.0088 km gives 4,224 km, which is 2,625 statute miles or 2,281 nautical miles.
The path leaves Boston heading 281.7° (WNW) and arrives on a heading of 247.7°. A constant-heading rhumb line would steer 264.4° the whole way and cover 2,662 miles.
How to use it
- Type the first place in Origin and the second in Destination, or click the map twice. Use GPS sets the origin to where you are.
- A line joins the two markers and the map zooms to fit them.
- Read the result card: kilometers and miles, nautical miles, initial and final bearing, and the rhumb bearing.
- Press Compare driving for the road distance, driving time, and how much longer the road is than the straight line.
How the distance is measured
Each place becomes a latitude and longitude, either from your click or from the Photon geocoder when you search. The tool then applies the haversine formula, which gives the length of the shortest path between two points over the surface of a sphere. It uses the mean Earth radius of 6,371.0088 km.
A sphere is a close model of the Earth. The real shape is slightly flattened, so a sphere can be off by a fraction of a percent, depending on direction and latitude. That is far smaller than the uncertainty from treating a whole town as one point. The distance guide walks through the formula step by step.
Three bearings, and why they differ
The initial bearing is the compass direction you face at the start of the great-circle path. The final bearing is the direction you are heading when you arrive. On a long east-west trip they differ because a great circle crosses each meridian at a slightly different angle.
The rhumb bearing is the single heading that gets you there if you never turn. It is longer than the great circle but easier to steer. All three are measured from true north. The tool does not apply magnetic declination, so a handheld compass reads differently by the local declination.
Straight line versus the road
Press Compare driving to ask the Valhalla router for a road route between the same points. If Valhalla fails, the tool tries the OSRM demo router. When both fail, it says driving distance is unavailable and never estimates it from the straight line.
The detour figure it prints is how much longer the road route is than the straight line, as a percentage. It varies with terrain and road layout, so it is only meaningful for the pair you asked about.
Questions people ask
Is this the flying distance?
It is the great-circle distance, the shortest path over the surface. Real flights add routing and climb, so flown distance is usually longer.
Why are there two bearings?
A great circle changes heading along the way, so the heading at the start differs from the heading at the end.
Which Earth radius is used?
The mean radius of 6,371.0088 km.
Sources and data as of
Data as of: computed from the haversine formula and the capital coordinates stored on this site.
- 01Photon geocoder (OpenStreetMap data)
- 02Valhalla routing, FOSSGIS public instance
- 03OSRM public demo router
How every number is computed: methodology. Spotted a wrong figure? Report an error.