The Haversine distance calculator computes the great-circle distance between two GPS coordinate pairs. Enter coordinates in Decimal Degrees (DD) or Degrees Minutes Seconds (DMS) format to get distance in km, miles, and nautical miles, plus initial bearing and midpoint coordinates.
Point A
Point B
Results
Map will appear after calculation
How to Use the Haversine Distance Calculator
The Haversine distance calculator calculates the great-circle (shortest surface path) distance between any two GPS coordinate pairs. Unlike the city-based distance tool, this calculator accepts raw latitude/longitude values in both Decimal Degrees and DMS formats.
Step 1: Enter Coordinates for Point A
Enter the latitude and longitude for the first point. You can use Decimal Degrees (DD) format — for example, 40.7128 for latitude and -74.0060 for longitude (negative values indicate South latitude or West longitude). Alternatively, use DMS format: 40 42 46 N and 74 0 22 W.
Step 2: Enter Coordinates for Point B
Enter the latitude and longitude for the second point using the same format options. The tool automatically parses whichever format you use for each field.
Step 3: Click Calculate Distance
Click the Calculate Distance button. The tool applies the Haversine formula and returns the distance in all three units simultaneously, plus initial bearing and midpoint coordinates. The Leaflet map shows both points with a connecting line.
Understanding the Haversine Formula
The Haversine formula calculates great-circle distance using spherical trigonometry. Given two points with latitudes φ₁, φ₂ and longitudes λ₁, λ₂:
a = sin²(Δφ/2) + cos(φ₁) · cos(φ₂) · sin²(Δλ/2)
c = 2 · atan2(√a, √(1−a))
d = R · c where R = 6,371 km (Earth's mean radius)
Initial Bearing Explained
The initial bearing is the compass direction you would face at Point A to start traveling toward Point B along the great-circle route. It's measured in degrees clockwise from true north (0° = North, 90° = East, 180° = South, 270° = West). Important: great-circle routes don't follow a fixed compass bearing — the bearing changes continuously as you travel. The value returned is the departure bearing only.
Geographic Midpoint
The midpoint coordinates represent the geographic center of the two points — the point equidistant from both along the great-circle path. This differs from a simple average of latitude/longitude values, which produces an incorrect result near the poles or when crossing the antimeridian (180° longitude).
FAQ
Is this Haversine calculator free?
Yes, completely free. No signup, no account, no limits. Enter any two GPS coordinates and get the distance instantly.
Is my location data safe?
All calculations run locally in your browser. No coordinates are sent to any server — your data never leaves your device.
What is the Haversine formula?
The Haversine formula calculates the great-circle distance between two points on a sphere given their latitudes and longitudes. It's named for the haversine function: hav(θ) = sin²(θ/2). The formula gives the shortest path along Earth's surface, accurate to within about 0.3% for most calculations.
What coordinate formats are supported?
The calculator supports both Decimal Degrees (DD) format like 40.7128, -74.0060 and Degrees Minutes Seconds (DMS) format like 40 42 46 N, 74 0 22 W. You can mix formats between the two points.
What is the initial bearing?
The initial bearing is the compass direction you would face at Point A to travel in a straight line toward Point B. Since great-circle routes follow Earth's curvature, this bearing changes as you travel. The value returned is the bearing at departure, measured in degrees from true north (0-360).
How accurate is the Haversine formula?
The Haversine formula assumes Earth is a perfect sphere with radius 6,371 km. Earth is actually slightly flattened (an oblate spheroid), introducing a maximum error of about 0.3%. For most practical uses — travel planning, navigation, geocaching — this accuracy is more than sufficient. The Vincenty formula is more precise but significantly more complex.
What is the difference between Haversine and Vincenty distance?
Both formulas calculate great-circle distance, but Vincenty accounts for Earth's ellipsoidal shape (flattened at the poles). For distances under 1,000 km, the difference is typically less than 0.1 km. For trans-oceanic distances, Vincenty is typically within 0.01% of Haversine. For most users, Haversine is accurate enough.