Compute the great-circle (as-the-crow-flies) distance between two latitude/longitude points using the haversine formula, plus the initial bearing from Point A to Point B.
Two Points
A
B
Try:
Decimal degrees only: latitude −90° to 90°, longitude −180° to 180°. Use negative values for south and west.
Great-circle distance
—
Enter both points to see the distance.
—
Initial bearing
—
Compass point
Great circle
Path type
Enter both points above to see the great-circle distance and bearing.
Initial bearing, A → B
—
Enter both points to compute the initial bearing.
The initial bearing is the compass heading at the very start of the great-circle route. Because the route curves relative to a flat map, this heading changes continuously along the way — it's only the direction you'd start out heading.
Heading
Distance in all three units
Unit
Distance
Great-circle vs. driving distance
This is the great-circle (straight-line) distance — the shortest possible path over Earth's curved surface, not a driving or flight route. Actual travel distance is equal to or longer than this, sometimes substantially so.
3 min read3 steps7 terms3 examples6 FAQsa = sin²(Δφ/2) + cos(φ1)·cos(φ2)·sin²(Δλ/2); c = 2·atan2(√a, …
Every "distance between two GPS coordinates" problem eventually reaches for the same formula: haversine.
📋
Walk-through
How to Use This Calculator
3 steps▸
1
Enter both points' latitude and longitude
Enter the latitude and longitude of Point A and Point B, in decimal degrees. Latitude ranges from -90 (South Pole) to 90 (North Pole); longitude ranges from -180 to 180 (negative is West, positive is East). Most map apps show coordinates when you long-press or right-click a location.
2
Pick your distance unit
Choose miles, kilometers, or nautical miles from the unit selector, or switch to the Unit Comparison tab to see all three at once. All three are computed from the same underlying calculation, so changing units never changes the result — only how it's displayed.
3
Read the distance and bearing
The Distance tab shows the great-circle distance — the shortest path over the Earth's curved surface, not a driving route — plus the initial compass bearing from Point A toward Point B. Switch to the Bearing tab for a closer look at the heading, with a compass dial.
⚡
Reference
Formula & Methodology
2 formulas▸
Haversine distance
a = sin²(Δφ/2) + cos(φ1)·cos(φ2)·sin²(Δλ/2); c = 2·atan2(√a, √(1−a)); d = R·c
φ1 and φ2 are the two latitudes and Δλ is the difference in longitude, all converted to radians. R is Earth's mean radius: 3,958.8 miles, 6,371 km, or 3,440.1 nautical miles. The haversine formula treats the Earth as a perfect sphere, which is accurate to within about 0.5% of the more complex ellipsoidal (Vincenty) formula — plenty precise for travel planning.
This is the compass heading you'd start out on along the great-circle path from Point A to reach Point B. Because a great-circle route curves relative to a flat map, this initial bearing generally is not the heading you'd hold for the entire trip — it's the direction only at the very start.
📖
Glossary
Key Terms Explained
7 terms▸
Great-circle distanceThe shortest possible path between two points on the surface of a sphere, following the arc of the great circle (a circle whose plane passes through the sphere's center) connecting them. On Earth, this is the "as-the-crow-flies" distance.
Haversine formulaA trigonometric formula that computes great-circle distance from two points' latitude and longitude, treating the Earth as a sphere. It's numerically stable for both very short and very long distances, which is why it's the standard choice over the simpler (but less stable) spherical law of cosines.
Latitude / longitudeThe pair of angles that locate any point on Earth. Latitude measures north-south position from the equator (-90° to 90°); longitude measures east-west position from the Prime Meridian (-180° to 180°).
BearingA compass direction, measured in degrees clockwise from true north (0°/360° = north, 90° = east, 180° = south, 270° = west). The initial bearing is the heading at the start of a great-circle route.
Nautical mileA unit of distance used in air and sea navigation, defined as one minute of arc along a great circle (about 1.15078 statute miles, or 1.852 km). It's convenient for navigation because 1 nautical mile equals 1 minute of latitude anywhere on Earth.
RadianThe unit of angular measure used inside the haversine formula's trigonometric functions — 180° equals π radians. Latitude and longitude, normally expressed in degrees, must be converted to radians before the sine/cosine calculations.
Earth radiusThe mean radius used to convert the angular great-circle distance into a linear distance: 3,958.8 miles, 6,371 km, or 3,440.1 nautical miles. Earth is technically an oblate spheroid (slightly flattened at the poles), so a spherical-mean-radius calculation like haversine carries a small (sub-1%) systematic error compared to an ellipsoidal model.
👥
Scenarios
Real-World Examples
3 worked examples▸
✈️
Transatlantic flight
JFK (New York) to LHR (London Heathrow)
Point A 40.6413° N, 73.7781° W (JFK)Point B 51.4700° N, 0.4543° W (LHR)
The great-circle distance between JFK and LHR is about 3,442 miles (5,540 km, 2,991 nautical miles), on an initial bearing of roughly 51° (northeast). This is the theoretical minimum distance; actual flight paths are usually a bit longer due to air-traffic routing, weather diversions, and jet-stream optimization.
🌍
Same route, all three units
Unit Comparison tab
Distance in miles ≈3,442 miDistance in kilometers ≈5,540 kmDistance in nautical miles ≈2,991 nmi
All three numbers describe the exact same great-circle arc — only the conversion factor (Earth's radius in that unit) changes. Nautical miles are the standard unit in aviation and maritime navigation, which is why flight-planning tools often default to it.
🧭
Reading the bearing
Bearing tab — initial compass heading
Initial bearing ≈51°Compass point NE
A bearing of 51° means you'd start out heading just north of due-northeast from JFK. Because great-circle routes curve on a standard flat map projection, this starting heading is not the compass direction you'd hold for the whole flight — only the heading at the very beginning of the route.
Every "distance between two GPS coordinates" problem eventually reaches for the same formula: haversine. This calculator puts it in one place — enter two latitude/longitude points and get the true as-the-crow-flies distance between them, in whichever unit you need, plus the compass bearing to head at the start of the trip.
Why not just use the Pythagorean theorem?
▸
Latitude and longitude are angles on a curved surface, not flat x/y coordinates — a degree of longitude covers a shrinking real-world distance as you move away from the equator toward the poles. Treating coordinates like flat Cartesian points, the way a simple Pythagorean-distance calculator does, gives badly wrong answers for anything beyond a very small area. The haversine formula accounts for the Earth's curvature directly, which is why it's the standard for any real-world lat/long distance problem — flights, shipping routes, delivery radius calculations, and more.
Great-circle distance vs. driving distance
▸
The number this calculator returns is a straight-line, over-the-curved-surface distance — not a driving or flying route. Roads bend around terrain, property lines, and infrastructure; flight paths bend around air-traffic corridors, weather, and jet streams. Great-circle distance is always the theoretical minimum; actual travel distance is equal to or longer than it, sometimes substantially so for routes with few direct roads or flight paths.
What the bearing tells you (and doesn't)
▸
The initial bearing is the compass heading at the very start of the great-circle route. Because a great circle looks curved on a standard flat map — the same reason flight paths on an airline map appear to arc northward on transatlantic routes — the compass heading actually changes continuously along the route. The initial bearing is only the direction you'd start out heading, not a single heading held for the entire trip.
❓
Questions
Frequently Asked Questions
6 questions▸
What is great-circle distance?+
The shortest possible path between two points on Earth's surface, following the curve of the sphere rather than a straight line through the Earth or a flat-map straight line. It's often called "as-the-crow-flies" distance.
What is the haversine formula?+
The standard trigonometric formula for computing great-circle distance from two points' latitude and longitude, assuming Earth is a sphere. It's numerically stable and widely used in navigation, aviation, and mapping software.
Is this the same as driving distance?+
No. Great-circle distance is a straight-line (over the curved surface) distance — it ignores roads, terrain, and flight paths entirely. Actual driving or flying distance is always equal to or longer than the great-circle distance.
What's a nautical mile?+
A unit of distance used in sea and air navigation, equal to about 1.15 statute miles (1.852 km). It's defined as one minute of latitude, which makes it convenient for navigation.
How do I find latitude and longitude coordinates?+
Most map apps (Google Maps, Apple Maps, etc.) show coordinates when you long-press or right-click a location, or you can search an address and open its details. Coordinates are usually given as decimal degrees, matching what this calculator expects.
What is initial bearing?+
The compass direction (0-360°, measured clockwise from north) you'd head in at the very start of the great-circle route from Point A to Point B. Because great-circle routes curve on a flat map, this heading changes along the way — it's only the starting direction.
📄
Save & share
Get a branded PDF of your results
Download a one-page PDF of your numbers instantly. Add your email to also get our occasional calculator tips — no spam, unsubscribe anytime. Privacy.