Distance & Bearing Calculator

Enter two coordinates to get the great-circle distance in km, miles, and nautical miles — plus forward and back compass bearing — using Haversine or the precise Vincenty formula.

Share this tool

Point A

Point B

Formula:
Quick Load:

First row must be a header. Columns: label, lat_a, lon_a, lat_b, lon_b. Max 500 rows.

All batch rows use the Haversine formula.

Calculating...

Enter two coordinate pairs above and click Calculate.

What Is Great-Circle Distance?

A great-circle distance is the shortest path between two points on the surface of a sphere. Unlike driving distance, which follows roads, or straight-line distance on a flat map, the great-circle route curves around the Earth's surface. This is the route followed by ships crossing oceans, aircraft flying intercontinental legs, and any navigation system that must account for the Earth's curvature.

The term "great circle" refers to any circle formed by the intersection of the Earth's surface and a plane passing through the Earth's centre. The equator and every line of longitude are great circles. Parallels of latitude (except the equator) are not great circles, which is why flights from London to Los Angeles curve north over Canada rather than flying due west.

Great-Circle vs. Rhumb Line

A BGreat Circle Rhumb Line (straight on flat map)

The great-circle route (teal) curves north of the rhumb line (grey dash) to find the shortest path over the sphere.

Haversine vs. Vincenty — Which Formula Should You Use?

The Haversine formula treats the Earth as a perfect sphere. It is extremely fast and accurate to within about 0.3% of the true geodetic distance — around 3 km over a 1,000 km route. For most applications — GIS analysis, logistics routing, app development, and quick field estimates — Haversine is the right choice.

The Vincenty formula uses the WGS84 ellipsoid model (semi-major axis 6,378,137 m, flattening 1/298.257223563). It converges iteratively to sub-millimetre accuracy, making it mandatory for survey work, aviation charts, precision marine navigation, and any calculation where millimetre-level accuracy matters. The only edge case is antipodal points (opposite sides of the Earth), where Vincenty can fail to converge; this calculator automatically falls back to Haversine in those rare cases.

FormulaEarth ModelAccuracyBest For
HaversineSphere (R = 6,371 km)≈ 0.3% max errorGIS, web apps, logistics, quick estimates
VincentyWGS84 ellipsoidSub-millimetreSurveying, aviation charts, marine nav

How Forward and Back Bearing Work

Bearing is measured in degrees clockwise from true north (0° = North, 90° = East, 180° = South, 270° = West). The forward bearing is the compass direction you face at Point A when pointing toward Point B. The back bearing is the direction you face at Point B when pointing back toward Point A.

Because the Earth is a sphere, the back bearing is not simply the forward bearing plus 180°. On long intercontinental routes, the difference can be significant. For example, flying from London to New York, the forward bearing is roughly 288° (WNW). The back bearing from New York to London is approximately 51° (NE) — not 108°. This is because great-circle routes curve relative to lines of latitude, changing compass direction continuously along the route.

Distance and Bearing in Aviation, Marine, and Surveying

In aviation, bearing is called a true track or magnetic bearing (after applying magnetic declination). Flight plans specify the initial true track from departure to destination. Long-haul aircraft continuously recalculate bearing because the great-circle track constantly changes heading — what pilots call the rhumb line correction.

Marine navigators use great-circle sailing for ocean passages. A vessel sailing from Cape Town to Buenos Aires follows a great circle that dips well south of the direct rhumb line, saving hundreds of kilometres. The initial bearing is plotted as a series of straight rhumb-line segments that approximate the curve.

In land surveying, Vincenty bearings are used when measuring property boundaries or control networks. Even at distances of 5–10 km, the difference between spherical and ellipsoidal bearing can exceed the survey closure tolerance.

Common Route Distances and Bearings

RouteDistance (km)Distance (mi)Fwd Bearing
London → New York5,5403,442288° WNW
Sydney → Los Angeles12,0747,50357° NE
Nairobi → Riyadh3,0281,88127° NNE
Tokyo → San Francisco8,2795,14454° NE
Cape Town → Buenos Aires6,8674,267248° WSW

How to Use CSV Batch Mode

Switch to the CSV Batch tab to calculate distances for multiple coordinate pairs at once. The format is straightforward:

label,lat_a,lon_a,lat_b,lon_b
London to Paris,51.5074,-0.1278,48.8566,2.3522
NYC to LA,40.7128,-74.006,34.0522,-118.2437

The first row must be a header (any text — it is skipped). Each subsequent row is one coordinate pair. Maximum 500 rows per submission. All batch calculations use the Haversine formula.

Frequently Asked Questions

What is the difference between Haversine and Vincenty distance?

Haversine treats Earth as a sphere and is fast and accurate to within 0.3%. Vincenty uses the WGS84 ellipsoid and is accurate to sub-millimetre precision. For distances under 100 km the difference is negligible; for intercontinental routes it can reach several kilometres.

How do I calculate the bearing between two GPS coordinates?

Enter the decimal degree latitude and longitude of both points into this tool and click Calculate. The forward bearing (A to B) and back bearing (B to A) are displayed instantly alongside the distance in all major units.

What is a back bearing and how is it different from forward bearing?

The forward bearing is the compass direction for travel from A to B. The back bearing is the direction you face at B when looking back toward A. On a sphere they differ by roughly 180°, but the exact difference depends on the route's latitude and longitude span. Vincenty calculates both simultaneously from the iterative convergence.

How accurate is the Haversine formula for long distances?

Maximum error is around 0.3% at long distances where Earth's oblateness matters most. On a 10,000 km route that is roughly 30 km. For precise surveying or aviation, use Vincenty. For web apps, mapping, and general GIS analysis, Haversine is entirely sufficient.

How do pilots and sailors use bearing in navigation?

Pilots file a true track in flight plans — the initial compass bearing toward the destination. Navigators break long ocean routes into waypoints and recalculate the bearing at each one because the great-circle heading changes continuously. Marine navigators similarly use a series of short rhumb-line legs to approximate the great-circle arc.

Can I calculate distance between more than two points at once?

Yes — use the CSV Batch tab. Paste up to 500 coordinate pairs in the format label, lat_a, lon_a, lat_b, lon_b and click Calculate Batch. Results appear in a scrollable table with distance in km, mi, and nm, plus both bearings.