More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

Distance & Bearing Calculator - GPS Coordinates

Free distance and bearing calculator: calculate great-circle distance, initial/final bearing between two GPS coordinates. Accurate geodesic distance calculator.

°
°
°
°

travel time Travel Time Estimator

How long the great-circle distance above takes at typical speeds (straight-line, no traffic).

ModeSpeed (km/h)Time

What is Distance & Bearing Calculation?

Distance and bearing calculations determine the shortest path and direction between two points on Earth's surface. The distance is calculated using the haversine formula (great-circle distance), which accounts for Earth's spherical shape. Bearing indicates the direction from one point to another, measured in degrees clockwise from north.

These calculations are essential for navigation, aviation, maritime operations, hiking, and any application involving movement between geographic locations. The results provide comprehensive information for route planning and navigation.

Key concepts:

  • Great-Circle Distance: The shortest distance between two points on a sphere's surface, following a great circle arc.
  • Initial Bearing (Forward Azimuth): The compass direction at the starting point toward the destination.
  • Final Bearing (Back Azimuth): The compass direction when arriving at the destination.
  • Midpoint: The geographic center point along the great-circle path between the two locations.

Understanding these measurements is crucial for navigation planning, whether you're piloting an aircraft, sailing a boat, planning a road trip, or analyzing geographic data.

How to Calculate Distance and Bearing

Distance and bearing calculations use spherical trigonometry formulas. The haversine formula calculates distance, while bearing is calculated using arctangent of the coordinate differences.

Distance Formula (Haversine):

d = 2r × arcsin(√(sin²(Δφ/2) + cos(φ₁) × cos(φ₂) × sin²(Δλ/2)))

Initial Bearing Formula:

θ = atan2(sin(Δλ) × cos(φ₂), cos(φ₁) × sin(φ₂) - sin(φ₁) × cos(φ₂) × cos(Δλ))

Where:

  • d = great-circle distance
  • r = Earth's radius (6,371 km or 3,959 miles)
  • φ₁, φ₂ = latitude of point 1 and point 2 (in radians)
  • Δφ = difference in latitude
  • Δλ = difference in longitude
  • θ = bearing angle (converted from radians to degrees)

The initial bearing differs from the final bearing due to Earth's curvature. On a sphere, a straight path (great circle) continuously changes direction relative to north, except when traveling due north/south or along the equator.

Understanding Bearing Measurements

Bearing is measured in degrees clockwise from true north:

  • 0° / 360° = North
  • 90° = East
  • 180° = South
  • 270° = West

For example, a bearing of 45° means northeast, while 225° means southwest. Initial and final bearings differ because the shortest path on a sphere is not a straight line on a flat map—it's a curve on a globe.

Practical Applications

Distance and bearing calculations are used in:

  • Aviation: Flight planning, navigation, fuel calculations
  • Maritime: Ship routing, coastal navigation, offshore operations
  • Land Navigation: Hiking, orienteering, search and rescue
  • Logistics: Delivery route optimization, transportation planning
  • GIS & Mapping: Spatial analysis, proximity calculations, geographic research
  • Mobile Apps: Location-based services, navigation apps, geocaching

Distance Conversion Examples

Common distance conversions:

  • 1 kilometer = 0.621371 miles = 0.539957 nautical miles
  • 1 mile = 1.60934 kilometers = 5,280 feet
  • 1 nautical mile = 1.852 kilometers = 1.15078 miles

Nautical miles are commonly used in aviation and maritime navigation because one nautical mile equals one minute of latitude, making chart navigation simpler.

About Distance & Bearing Calculator

Distance & Bearing Calculator computes the great-circle (orthodromic) distance, initial and final bearing, and midpoint between two GPS coordinates using the haversine formula. Built for pilots plotting flight routes, mariners cross-checking nautical charts, hikers planning trails, logistics teams estimating delivery distances, and developers building geo-aware apps. Results are returned in kilometres, miles, nautical miles, metres, or feet alongside travel-time estimates across walking, cycling, driving, train, and jet speeds. Try also our Coordinate Converter and Geohash Encoder Decoder.

Frequently Asked Questions

A great-circle distance is the shortest path on a perfect sphere — the arc of the unique circle whose center is Earth's center. A geodesic distance is the same idea on an ellipsoid (WGS84), so it accounts for Earth's polar flattening; results differ from spherical by at most about 0.5%. A rhumb line (loxodrome) is the path of constant compass bearing — easier to steer with a magnetic compass, but always longer than the great circle except along the equator or a meridian. For a transatlantic flight (say JFK to LHR ≈ 5,540 km great-circle), the rhumb line is roughly 5,765 km — a 4% penalty. Haversine gives great-circle; Vincenty and Karney's algorithm give geodesic. This calculator uses haversine for speed and reports results in both km and miles.

Haversine assumes Earth is a perfect sphere with radius 6,371 km. Its error versus the true WGS84 geodesic is bounded by Earth's flattening — about 0.3% near the equator and up to 0.5% at high latitudes. For a 1,000 km route, that's roughly 3-5 km of disagreement, which is fine for delivery zones, fitness apps, sailing weather, or back-of-envelope navigation. Vincenty's iterative formulae (1975) work on an ellipsoid and reach sub-millimeter accuracy, but they fail to converge for nearly-antipodal points. Karney's algorithm (2013) is the modern gold standard: always converges, always sub-millimeter, used by GeographicLib. Use haversine unless you're doing surveying, aviation flight planning, or geodetic research — then promote to Karney's GeographicLib bindings.

Bearing in navigation is the angle measured clockwise from true north to the line connecting two points, expressed in degrees from 0° to 360°. 0° (or 360°) is due north, 90° is east, 180° south, 270° west. Compass heading reads the same angle but uses magnetic north, which differs from true north by the magnetic declination — currently about 11° W in New York, 1° E in London, and varying continuously. To convert: compass heading = true bearing − east declination (or + west declination). This calculator returns initial bearing (the heading at the starting point) and final bearing (the heading you'd be on when you arrive); on a long great-circle route the two differ — a flight from London to Tokyo starts heading roughly northeast and arrives heading roughly southeast.

On a flat plane, going from A to B at bearing 90° means returning from B to A at bearing 270°, exactly 180° apart. On a sphere or ellipsoid this only holds along the equator or a meridian. On every other great circle the bearing changes continuously as you travel, so the initial bearing from A and the initial bearing from B differ from each other by more than 180° on east-going routes in the northern hemisphere and less than 180° on west-going ones. For example, New York (40.71° N, 74.01° W) to Madrid (40.42° N, 3.70° W) has initial bearing ≈ 67° and final bearing ≈ 102°; the reverse trip from Madrid has initial bearing ≈ 282° (= 102° + 180°). This is geometry, not a bug — and it's why pilots periodically update heading on long routes.

The nautical mile is defined as exactly 1,852 m (1.852 km), so it equals 1.150779 statute miles. It was originally defined as 1 minute of arc along a meridian, which is why aviation and maritime navigation favor it — 60 nm corresponds to 1° of latitude. Useful conversions: 1 km = 0.621371 mi (statute) = 0.539957 nm = 3,280.84 ft = 1,093.61 yd. 1 statute mile = 1.609344 km. A knot is 1 nautical mile per hour; a vessel at 10 knots covers 18.52 km/h or 11.51 mph. This calculator outputs km, miles, and meters by default; multiply km by 0.539957 for nautical miles if you're flight-planning or sailing. For precise distances under 1 km, prefer meters — the rounding error of converting through km becomes visible.

The haversine formula computes great-circle distance as: a = sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2); c = 2·atan2(√a, √(1−a)); d = R·c, where φ is latitude, λ is longitude in radians, and R is Earth's mean radius (6,371 km). It was introduced by James Inman in 1835 specifically for navigation. The simpler spherical law of cosines — d = R·acos(sin(φ₁)·sin(φ₂) + cos(φ₁)·cos(φ₂)·cos(Δλ)) — gives the same answer mathematically but loses precision for very short distances because the argument of acos approaches 1, where small floating-point errors get amplified. Haversine uses sin² of half-angles, which stays numerically stable down to centimeter scales. That's why every modern routing library uses it.

This is the direct geodesic problem (the inverse of what this calculator solves). On a sphere the formulae are: φ₂ = asin(sin(φ₁)·cos(d/R) + cos(φ₁)·sin(d/R)·cos(θ)) and λ₂ = λ₁ + atan2(sin(θ)·sin(d/R)·cos(φ₁), cos(d/R) − sin(φ₁)·sin(φ₂)), where θ is the initial bearing in radians and d/R is the angular distance. Normalize the resulting longitude to [-180°, 180°]. For ellipsoidal accuracy use Vincenty's direct method or GeographicLib's `Geodesic::Direct`. This is the same math behind GPX route waypoint generation, drone flight planning, and dead-reckoning navigation systems. Some routing libraries expose it as `destinationPoint(lat, lng, bearing, distance)` — for example Turf.js's `turf.destination()`.

Thaddeus Vincenty's 1975 algorithms solve the geodesic problem on a biaxial ellipsoid (WGS84) using iterative series expansions. The inverse formula (distance + initial/final bearing from two coordinates) converges to better than 0.5 mm for any non-antipodal pair; the direct formula (endpoint from start + bearing + distance) is exact to similar precision. Use Vincenty when you need sub-meter geodesic accuracy: surveying, cadastral boundaries, aviation flight planning, ship route optimization, scientific oceanography, or anything submitted to a regulatory body. The drawback is that Vincenty's inverse can fail to converge for nearly-antipodal points (separated by ~180°); Charles Karney's 2013 algorithm fixes this and is implemented in GeographicLib, PostGIS (`ST_Distance` with `use_spheroid=true`), and the Python `geographiclib` package. For everyday web app distances (delivery, ride-share, fitness tracking) haversine is faster and accurate enough.
Distance & Bearing Calculator - GPS Coordinates — Free distance and bearing calculator: calculate great-circle distance, initial/final bearing between two GPS coordinates
Distance & Bearing Calculator - GPS Coordinates