MathsFree

Distance Between Coordinates Calculator

Calculate the straight-line (great-circle) distance between two points on Earth using latitude and longitude coordinates. This calculator uses the haversine formula with a mean Earth radius of 6,371 km to compute the shortest path over the surface of the sphere. Results are shown in both kilometers and miles. Used in navigation, aviation, logistics, GIS mapping, and geocaching.

Enter Values

Result

Enter values above and click Calculate to see your result.

AI Assistant

Ask about this calculator

I can help you understand the distance between coordinates calculator formula, interpret your results, and answer follow-up questions.

Try asking

Formula

a = sin^2(dlat/2) + cos(lat1) x cos(lat2) x sin^2(dlon/2); c = 2 x atan2(sqrt(a), sqrt(1-a)); d = R x c.

The haversine formula computes the central angle between two points on a sphere from their latitude and longitude (converted to radians), then multiplies by the Earth radius (6,371 km) to get the surface distance. This accounts for the curvature of the Earth, unlike flat-plane distance formulas which only work for very short distances.

Worked Example

Distance from Paris (48.8566, 2.3522) to London (51.5074, -0.1278): Step 1: Convert coordinates to radians Step 2: dlat = 0.04626 rad, dlon = -0.04317 rad Step 3: a = sin^2(0.02313) + cos(0.8527) x cos(0.8989) x sin^2(-0.02159) = 0.000895 Step 4: c = 2 x atan2(0.02992, 0.99955) = 0.05984 rad Step 5: d = 6371 x 0.05984 = 343.6 km (213.5 miles)

Frequently Asked Questions

Why is haversine distance different from driving distance?

The haversine formula calculates the shortest path over the surface of a perfect sphere (as the crow flies). Driving distance follows roads, highways, and terrain, which is always longer. Use this for straight-line distance; use a mapping service for driving directions.

What Earth radius does this calculator use?

It uses 6,371 km, the widely accepted mean Earth radius. Since Earth is slightly flattened at the poles (oblate spheroid), this value introduces a small error of up to 0.3% for very long distances. For most practical purposes, this is more than accurate enough.

Can I enter coordinates in degrees, minutes, seconds?

This calculator accepts decimal degrees only. To convert DMS to decimal: degrees + (minutes / 60) + (seconds / 3600). For example, 48 degrees 51 minutes 23 seconds = 48.8564 decimal degrees.

Does this work for any two points on Earth?

Yes. The haversine formula works for any pair of latitude/longitude coordinates, including across hemispheres, the international date line, and near the poles. Latitude must be between -90 and 90, longitude between -180 and 180.

How accurate is the haversine formula?

For most distances, haversine is accurate to within 0.3% (about 1 km error per 300 km). For higher accuracy on very long distances, the Vincenty formula accounts for Earth being an oblate spheroid, but haversine is sufficient for the vast majority of applications.

Accurate and Reliable

All calculations run locally. Step-by-step solutions you can trust.

Precise Mathematical Calculations Powered by Calculory AI