Lat/Lon Distance Calculator | Calculate Distance Between Coordinates

Latitude Longitude Distance Calculator

Calculate the distance between two latitude and longitude coordinates. This shows the great circle distance (shortest path over Earth’s surface) between point A and point B.

Finds the distance between two points on Earth using their coordinates.

Last updated: March 2026 | By Summa Calculator

Great circle distance · shortest path over Earth’s surface
Enter two latitude and longitude coordinates to calculate distance and initial bearing
Point A
Point B
Enter coordinates for both points to calculate distance

What is the Haversine Formula?

The Haversine formula is a mathematical equation used to calculate the great circle distance between two points on a sphere when you know their longitudes and latitudes. The name comes from the haversine function: hav(θ) = sin²(θ/2). This formula is particularly important in navigation, whether for aviation, maritime, or GPS-based applications.

A great circle is the shortest path between two points on a sphere's surface. Imagine slicing the Earth with a plane that passes through both points and Earth's center. The Haversine formula calculates the central angle between two points, then uses Earth's radius to determine the actual distance along this curved path. This is more accurate than calculating straight-line Euclidean distance, which would tunnel through the Earth.

The formula assumes Earth is a perfect sphere with radius 6,371 kilometers (3,959 miles). In reality, Earth is slightly ellipsoidal, flattened at the poles and bulging at the equator. For most practical purposes, especially distances under a few hundred kilometers, the spherical approximation is accurate enough. For high-precision surveying over long distances, geodetic formulas like Vincenty's formulae account for Earth's ellipsoidal shape.

How to Use This Calculator

The Haversine Formula

a = sin²(Δφ/2) + cos(φ₁) × cos(φ₂) × sin²(Δλ/2)
c = 2 × atan2(√a, √(1−a))
d = R × c
φ = latitude, λ = longitude, R = Earth's radius (6,371 km)
Δφ = φ₂ - φ₁, Δλ = λ₂ - λ₁

Steps to Calculate

1

Enter Coordinates

Input latitude and longitude for both points. Use decimal degrees (e.g., 40.7128 instead of 40°42'46"N). Negative values for South latitudes and West longitudes.

2

View Distance

The calculator instantly shows the great circle distance in kilometers, statute miles, and nautical miles. This is the shortest surface distance between the two points.

3

Check Bearing

The initial bearing shows the compass direction you would face at Point A to look toward Point B. Note that the bearing changes along the great circle route.

Example Calculation

Calculate the distance from New York City to London:

Point A:
New York City
φ₁ = 40.7128° N
λ₁ = -74.0060° W
Point B:
London
φ₂ = 51.5074° N
λ₂ = -0.1278° W
Calculation:
Δφ = 51.5074 - 40.7128 = 10.7946°
Δλ = -0.1278 - (-74.0060) = 73.8782°
Apply Haversine formula...
Result:
5,570 km
≈ 3,461 miles | ≈ 3,008 nautical miles
Initial bearing: 51.38° (Northeast)

Frequently Asked Questions

Why not just use Pythagorean theorem?

The Pythagorean theorem works for flat surfaces, but Earth is a sphere. Calculating straight-line distance would tunnel through the Earth. The Haversine formula follows Earth's curved surface, giving the actual travel distance.

What's a great circle route?

A great circle is the shortest path between two points on a sphere's surface. Airlines follow great circle routes to minimize distance. On flat maps, these routes often appear curved, but they're actually the straightest possible path on a sphere.

How accurate is this calculator?

The Haversine formula is accurate to within 0.5% for most distances. It assumes a spherical Earth (radius 6,371 km). For surveying or long distances requiring higher precision, use Vincenty's formula which accounts for Earth's ellipsoidal shape.

Why does bearing change along the route?

On a sphere, only meridians (north-south lines) are truly straight. Great circle routes cross meridians at changing angles, so your compass heading must continuously adjust. Only routes along meridians or the equator maintain constant bearings.

What's the difference between miles and nautical miles?

A nautical mile (1.852 km) is based on one minute of latitude. It's used in aviation and maritime navigation because it relates directly to Earth's geometry. A statute mile (1.609 km) is the common land measurement in the US.

Can this calculate driving distance?

No, this calculates straight-line distance along Earth's surface. Driving distance is longer due to roads, terrain, and obstacles. Use mapping services like Google Maps for actual driving distances and routes.

How do you calculate distance between two coordinates?

Use the haversine formula to calculate the great circle distance between two latitude and longitude points.

What is the distance between two points on Earth called?

It is called the great circle distance, the shortest path between two points on a sphere.

What's the maximum distance possible?

The maximum distance between any two points on Earth is half the circumference: about 20,037 km (12,451 miles). These are antipodal points, opposite sides of the planet.

How do I convert degrees/minutes/seconds to decimal?

Convert using: Decimal = Degrees + (Minutes/60) + (Seconds/3600). For example, 40°42'46"N = 40 + (42/60) + (46/3600) = 40.7128°. South and West are negative.

Related Tools