Route Distance Calculator (Lat/Long)
Free Route distance between coordinates Calculator for freight & shipping. Enter your stats to get performance metrics and improvement targets.
Route Distance Calculator (Lat/Long)
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: d = 2R × arctan2(√a, √(1-a)) where a = sin²(Δlat/2) + cos(lat1)·cos(lat2)·sin²(Δlon/2)
Worked example — Straight line: 5,570 km (3,461 mi) | Bearing: 51.2° ENE
Formula
d = 2R × arctan2(√a, √(1-a)) where a = sin²(Δlat/2) + cos(lat1)·cos(lat2)·sin²(Δlon/2)
The Haversine formula calculates the great-circle distance between two points on Earth's surface. The route distance multiplies this by a detour factor (typically 1.2-1.5) to approximate real-world road distances, since roads do not follow straight lines.
Worked Examples
Example 1: New York to London
Problem:Calculate the distance between New York (40.7128°N, 74.0060°W) and London (51.5074°N, 0.1278°W).
Solution:Lat1=40.7128, Lon1=-74.0060, Lat2=51.5074, Lon2=-0.1278 Haversine: dLat=10.7946°, dLon=73.8782° a = sin²(5.397°) + cos(40.71°)×cos(51.51°)×sin²(36.94°) d = 2 × 6371 × arctan2(√a, √(1-a)) d = 5,570 km straight line Bearing: 51.2° (ENE)
Result:Straight line: 5,570 km (3,461 mi) | Bearing: 51.2° ENE
Example 2: Tokyo to Sydney
Problem:Calculate route distance from Tokyo (35.6762°N, 139.6503°E) to Sydney (33.8688°S, 151.2093°E) with a route factor of 1.1 (mostly sea route).
Solution:Lat1=35.6762, Lon1=139.6503, Lat2=-33.8688, Lon2=151.2093 Haversine calculation: d = 7,822 km straight line Route distance = 7,822 × 1.1 = 8,604 km Bearing: 165.3° (SSE)
Result:Straight: 7,822 km | Route: 8,604 km | Bearing: 165.3° SSE
Frequently Asked Questions
What is the Haversine formula?
The Haversine formula calculates the great-circle distance between two points on a sphere given their latitude and longitude coordinates. It accounts for the Earth's curvature, making it far more accurate than simple Euclidean distance for geographic calculations. The formula uses the haversine function (half-versine), defined as hav(theta) = sin²(theta/2). The complete formula is: a = sin²(dlat/2) + cos(lat1) × cos(lat2) × sin²(dlon/2), then d = 2R × arctan2(sqrt(a), sqrt(1-a)), where R is Earth's radius (6,371 km). The Haversine formula assumes a perfect sphere, which introduces a maximum error of about 0.3% compared to calculations using the WGS84 ellipsoid model.
What is the difference between straight-line and route distance?
Straight-line distance (also called as-the-crow-flies or geodesic distance) is the shortest path between two points on Earth's surface along the great circle. Route distance is the actual distance you would travel on roads, highways, or shipping lanes, which is always longer due to the road network not following perfect straight lines. The ratio of route distance to straight-line distance is called the detour factor or circuity factor. In urban areas, this factor is typically 1.2-1.4, meaning roads add 20-40% over straight-line distance. In mountainous or rural areas with limited road networks, the factor can be 1.5-2.0 or higher. Route Distance Calculator (Lat/Long) uses a configurable route factor to estimate realistic travel distances.
How accurate is coordinate-based distance calculation?
The Haversine formula provides accuracy within about 0.3% for any two points on Earth, which is sufficient for most practical applications. The main source of error is that it models Earth as a perfect sphere with radius 6,371 km, when Earth is actually an oblate spheroid (slightly flattened at the poles). For higher accuracy, the Vincenty formula uses the WGS84 ellipsoid and achieves accuracy to within 0.5mm but is computationally more complex. For typical navigation purposes, Haversine accuracy is excellent — a 0.3% error on a 1,000 km trip means roughly 3 km difference. GPS coordinates themselves introduce some error: consumer GPS is accurate to about 3-5 meters, which is negligible for distance calculations between cities.
What is a bearing and how is it calculated?
A bearing is the compass direction from one point to another, measured in degrees clockwise from true north (0-360 degrees). The initial bearing (also called forward azimuth) is the direction you would face at the starting point to head toward the destination along the great-circle path. It is calculated using the formula: bearing = atan2(sin(dlon) × cos(lat2), cos(lat1) × sin(lat2) - sin(lat1) × cos(lat2) × cos(dlon)). Note that along a great-circle route, the bearing constantly changes (unlike a rhumb line which maintains constant bearing). A bearing of 0 degrees means due north, 90 degrees means due east, 180 degrees means due south, and 270 degrees means due west. Intermediate values correspond to intercardinal and secondary intercardinal directions.
How is travel time estimated from coordinates?
Travel time from coordinates is estimated by dividing the route distance by an assumed average speed. This provides a rough approximation because actual travel time depends on many factors not captured by coordinates alone: road type (highway vs city streets), traffic conditions, speed limits, terrain, border crossings, and rest stops. Highway travel between cities might average 80-100 km/h, while mixed urban and rural driving averages 40-60 km/h. For long international routes, average speeds might be lower due to varying road quality and border delays. Route Distance Calculator (Lat/Long) lets you set a custom average speed to improve the estimate. For accurate travel time predictions, real-time routing services that account for actual road networks and traffic conditions should be used.
How do I convert degrees-minutes-seconds coordinates into the decimal degrees Route Distance Calculator (Lat/Long) expects?
Take the degrees, add the minutes divided by 60 and the seconds divided by 3,600. So 40° 42' 46" becomes 40 + 42/60 + 46/3600 = 40.7128°. Sign carries the hemisphere: north latitude and east longitude are positive, south latitude and west longitude are negative, so London's 0° 7' 40" W is entered as -0.1278. Getting a sign wrong is the most common input error and typically throws the distance off by thousands of kilometres.
What is the difference between a great-circle route and a rhumb line?
A great circle is the shortest path over the sphere, and it is what the Haversine formula measures, but its bearing changes continuously along the way — which is why the calculator reports an initial bearing rather than a single course. A rhumb line, or loxodrome, holds one constant compass bearing and plots as a straight line on a Mercator chart, making it easier to steer but longer. The gap is negligible over short hops and grows with distance and latitude, which is why long-haul flights arc poleward on a flat map.
Why does the result include nautical miles alongside kilometres?
The nautical mile is the standard unit for marine and air navigation because it is tied to the geometry of the globe: it is defined as exactly 1,852 metres, which is very close to one arcminute of latitude along a meridian. That makes distance directly readable off a chart's latitude scale, and it makes speed in knots — one nautical mile per hour — line up with position plotting. Converting from kilometres uses a factor of 0.539957 nautical miles per kilometre.
Why is the reported midpoint not simply the average of the two latitudes and longitudes?
Averaging coordinates treats the grid as flat, which fails wherever the meridians converge or the path crosses the antimeridian. The geodesic midpoint is instead found by converting both points to Cartesian components, summing them, and converting back to latitude and longitude, which places the point halfway along the great circle itself. On a short local hop the two methods agree closely; on a transoceanic pair such as Tokyo to Los Angeles the naive average can sit hundreds of kilometres off the actual route.
Why use the Haversine formula rather than the spherical law of cosines?
Both give the same great-circle distance in exact arithmetic, but the law of cosines takes the arccosine of a value that approaches 1 for nearby points, where limited floating-point precision makes the result unstable and can round short distances to zero. The haversine form works with a half-angle sine and an arctan2, which stays well-conditioned at small separations and at antipodes alike. The cheaper equirectangular approximation is faster still, but its error grows quickly with latitude and distance.
References
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮Driving Distance Calculator
Calculate driving distance with inputs, formulas, and instant results.
🧮Flight Distance Calculator
Calculate flight distance with inputs, formulas, and instant results.
🧮Speed Distance Time Calculator
Calculate any of speed, distance, or time when given the other two values.
🧮Drive Time Calculator
Estimate driving time between two locations accounting for speed limits and breaks.
🧮Carpool Savings Calculator
Calculate how much you save by carpooling based on distance, fuel costs, and passengers.
🧮Frequent Flyer Miles Calculator
Calculate how many frequent flyer miles you need for a free flight by airline and route.