Geodesic Distance Calculator

Measure the shortest surface path between two coordinates — distance on the WGS84 ellipsoid, initial and final bearings, and the midpoint.

Point A (origin)

Enter decimal degrees. Pasting a “latitude, longitude” pair from a map app into either field splits it automatically.

Point B (destination)

Geodesic result

Shortest surface distance

Initial bearing (leaving A)

Final bearing (arriving at B)

Midpoint

Enter both points to compute the geodesic.
Equirectangular graticule; the arc shape is schematic, not a navigation chart.

Model and formula

Ellipsoid (WGS84): Karney’s inverse geodesic solution — a = 6,378,137 m, f = 1/298.257223563

Sphere: a = sin²(Δφ/2) + cos φ₁·cos φ₂·sin²(Δλ/2); d = 2R·atan2(√a, √(1−a)); R = 6,371.0088 km

Azimuths are taken along the geodesic at A and at B, clockwise from true north, normalized to 0–360°.

Method and sources

Distance and azimuths solve the inverse geodesic problem on the WGS84 ellipsoid using Karney’s algorithm, which converges for every pair of points, including near-antipodal ones. The midpoint lies at half the geodesic arc length. The comparison line applies the haversine formula on a sphere of the IUGG mean radius 6,371.0088 km. Method and sources checked 11 August 2026.

Method checked
11 August 2026
WGS84
a = 6,378,137 m · f = 1/298.257223563

Both coordinates and every result are computed in your browser and never leave this device.

FAQ

How accurate is this distance?

The distance solves the geodesic on the WGS84 reference ellipsoid — the same Earth model used by geodetic software — and the algorithm itself agrees with the exact solution to a fraction of a millimetre. The sphere comparison line shows how much a simple great-circle answer differs: usually within 0.3%, rarely more than about 0.5%. Real trips are longer than either model, because roads, airways and terrain never follow the shortest arc.

Why are the initial and final bearings different?

A geodesic is the shortest path, not a constant-compass course. Your heading changes continuously along the arc, so the bearing you leave A on differs from the bearing you arrive at B with — the gap grows with distance and latitude. Only a trip along the equator or straight along a meridian keeps one bearing. Both values are measured clockwise from true north: 0° is north, 90° is east.

Can I use points near the poles or across the 180° meridian?

Yes. Enter latitude from −90° to 90° and longitude from −180° to 180°. The calculation always follows the shorter arc, even when it crosses the ±180° line or runs near a pole, and pairs that are nearly opposite each other on the globe work too.

My coordinates are in degrees, minutes and seconds — what do I enter?

Convert them to decimal degrees first: degrees + minutes ÷ 60 + seconds ÷ 3600, with south and west negative. 40°42′46″N 74°00′21″W becomes 40.7128, −74.0060. You can also keep an N, S, E or W letter on a decimal value and the tool applies the sign for you.

Where do I find coordinates to paste?

In most map apps, right-click a place (or long-press it on a phone) and choose the coordinates to copy a decimal “latitude, longitude” pair. Paste that pair into either field here and it splits into the two boxes automatically.

Understanding Geodesic Distance on the WGS84 Ellipsoid

The shortest path between two points on the surface of the Earth is not a straight line, but a curve that conforms to the planet's shape. Because the Earth is not a perfect sphere, calculating this path requires modeling the planet as an ellipsoid. The Geodesic Distance Calculator measures this shortest surface path between two coordinates on the WGS84 ellipsoid, which is the standard reference ellipsoid for global positioning and mapping.

When you input coordinates, the tool calculates the precise distance, the initial bearing when leaving the origin, the final bearing when arriving at the destination, and the exact midpoint of the journey. It also provides a comparison against a simpler spherical great-circle calculation and displays a schematic map of the path.

All calculations are performed locally. Both coordinates and every result are computed in your browser and never leave this device.


Input Parameters and Interactive Controls

The calculator requires coordinate inputs for two distinct locations:

  • Point A (origin): Requires a Latitude (decimal degrees from −90° to 90°) and a Longitude (decimal degrees from −180° to 180°).
  • Point B (destination): Requires a Latitude (decimal degrees from −90° to 90°) and a Longitude (decimal degrees from −180° to 180°).

Coordinate Entry and Formatting Rules

Coordinates must be entered in decimal degrees. If your source data uses degrees-minutes-seconds (DMS), you must convert them to decimal format before entry. The conversion formula is:

Decimal Degrees = degrees + minutes / 60 + seconds / 3600

South and West values must be negative — for example, 40°42′46″N 74°00′21″W becomes 40.7128, −74.0060. However, you can keep N, S, E, or W letters on a decimal value, and the tool will automatically apply the correct positive or negative sign.

If you copy a "latitude, longitude" pair from a modern mapping application, you can paste the copied text directly into either coordinate field. The tool will automatically split the pair into the respective latitude and longitude boxes.

Interface Controls

  • Load Tokyo–Osaka example: Instantly populates the input fields with pre-set coordinates for a quick demonstration of the tool's capabilities.
  • Clear: Empties all coordinate input fields.
  • Swap points: Swaps the coordinates of Point A and Point B, reversing the origin and destination.

Mathematical Models and Calculations

The calculator uses two distinct mathematical models to compute the distance between coordinates, allowing you to compare the accuracy differences between ellipsoidal and spherical representations of the Earth.

Ellipsoid Model (WGS84)

The primary calculation solves the inverse geodesic problem on the WGS84 ellipsoid using Karney’s algorithm. This method is highly precise and guarantees convergence for all pairs of points, including those that are nearly opposite (antipodal) or located near the poles. The ellipsoid parameters used are:

  • Semi-major axis (a) = 6,378,137 m
  • Flattening (f) = 1/298.257223563

The midpoint is calculated to lie at exactly half the geodesic arc length.

Sphere Model (Great-Circle)

For comparison, the tool also calculates the distance using the haversine formula on a sphere with a radius (R) of 6,371.0088 km, which is the International Union of Geodesy and Geophysics (IUGG) mean radius. The formulas used are:

a = sin²((Δφ) / 2) + cosφ₁ · cosφ₂ · sin²((Δλ) / 2)

d = 2R · atan2(√(a), √(1-a))

Where φ is latitude, λ is longitude, and R = 6,371.0088 km.


Understanding Bearings and Geodesics

A geodesic path on an ellipsoid does not maintain a constant compass heading. Because of the curvature of the ellipsoidal surface, the shortest path results in a continuously changing bearing.

  • Initial bearing (leaving A): The direction you must head when departing Point A.
  • Final bearing (arriving at B): The direction you will be heading when you arrive at Point B.

Azimuths are taken along the geodesic at A and at B, clockwise from true north, normalized to 0–360° (where 0° is true north and 90° is east). The initial bearing leaving Point A will differ from the final bearing arriving at Point B, except for journeys that run directly along the equator or straight along a meridian. These bearings are relative to true north, not magnetic compass readings.


Output Results and Visualizations

Once valid coordinates are entered, the tool displays the following outputs under the Geodesic result heading:

  • Shortest surface distance: The calculated ellipsoidal distance.
  • Initial bearing (leaving A)
  • Final bearing (arriving at B)
  • Midpoint: The exact coordinates of the halfway point.
  • Sphere (R = 6,371.0088 km): Displays the spherical distance and the exact difference from the ellipsoid result formatted as {distance} — {delta} from the ellipsoid result.
  • Schematic map of the geodesic from A to B: A visual representation of the path with the caption: "Equirectangular graticule; the arc shape is schematic, not a navigation chart."

The verification of these methods and sources was checked on 11 August 2026.


Rules, Edge Cases, and Error Handling

The calculator is designed to handle complex geographical edge cases, but it enforces strict validation rules on inputs.

Edge Cases

  • Coincident Points: If Point A and Point B are identical, the distance is zero. The tool displays the message: "The two points are identical, so the distance is zero and no bearing is defined." The status bar updates to: "Both points are identical — the distance is zero."
  • Antipodal and Polar Paths: The tool successfully calculates paths near the poles, across the 180° meridian, and between nearly opposite (antipodal) points on the globe by always following the shorter arc.

Error Messages

If an input violates formatting or physical boundaries, the tool displays specific error messages where {where} is replaced by "point A" or "point B", and {token} or {letter} is replaced by the invalid input:

  • Non-numeric values: {where}: “{token}” is not a number.
  • DMS formatting detected: {where}: use decimal degrees (for example 48.8566), not degrees-minutes-seconds.
  • Incorrect hemisphere letter: {where}: “{letter}” marks the wrong axis — use N or S for latitude and E or W for longitude.
  • Latitude out of bounds: {where}: latitude must be from −90° to 90°.
  • Longitude out of bounds: {where}: longitude must be from −180° to 180°.

Real-World Limitations

Distances follow the model Earth surface. Altitude, terrain, roads, and airspace routing are not included, so real travel is longer. Bearings are relative to true north; a magnetic compass reads a different angle that varies with place and date. For legal surveying or navigation sign-off, use professional geodetic software and official data.