📐 Math CalculatorsFree · No signup

Distance Calculator

Calculate the distance between two coordinate points using the distance formula. Also find midpoint and line length.

About the Distance Calculator

A distance calculator computes the straight-line distance between two geographic locations using latitude and longitude coordinates, or calculates the geometric distance between two points on a coordinate plane using the distance formula. Geographic distance is essential for travel planning, logistics route optimisation, real estate location analysis, geographic information systems (GIS), and any application where you need to know how far apart two places are on the Earth's surface. Our calculator uses the Haversine formula for geographic calculations, which accounts for the spherical curvature of the Earth and produces accurate great-circle distances — the shortest path across Earth's surface between any two points. Results are displayed in miles, kilometres, and nautical miles simultaneously. For coordinate geometry, it uses the standard 2D Euclidean distance formula (the Pythagorean theorem applied to coordinate differences), accepting points in any coordinate system. The calculator also handles batch distance calculations for multiple destination comparisons.

Formula

Haversine: d = 2R x arcsin(sqrt(sin²(Δlat/2) + cos(lat1)cos(lat2)sin²(Δlon/2))) | 2D: d = sqrt((x2-x1)² + (y2-y1)²)

How It Works

Geographic distance (Haversine formula): Δlat = lat2 - lat1 (in radians); Δlon = lon2 - lon1 (in radians). a = sin²(Δlat/2) + cos(lat1) x cos(lat2) x sin²(Δlon/2). c = 2 x atan2(sqrt(a), sqrt(1-a)). Distance = R x c, where R = 6,371 km (Earth's mean radius). Example: New York (40.7128°N, 74.0060°W) to London (51.5074°N, 0.1278°W): great-circle distance ≈ 5,570 km (3,461 miles). Coordinate plane distance formula: d = sqrt((x2-x1)² + (y2-y1)²). Example: points (3, 4) and (8, 16): d = sqrt((8-3)² + (16-4)²) = sqrt(25 + 144) = sqrt(169) = 13 units. Note: driving distance between any two locations is always longer than great-circle distance due to roads, terrain, and traffic — typically 20-40% further in populated areas.

Tips & Best Practices

  • 1 degree of latitude always equals approximately 111 km (69 miles) anywhere on Earth, making it a useful mental reference for north-south distances.
  • 1 degree of longitude varies with latitude: at the equator it equals 111 km, at 45° latitude it equals 78 km, at 60° latitude it equals 55 km, approaching zero at the poles.
  • Nautical miles: 1 nautical mile = 1.852 km = 1.151 statute miles. Nautical miles are used in aviation and maritime navigation because 1 nautical mile equals exactly 1 minute of arc along any meridian.
  • The Haversine formula gives accurate results for any distance including long transcontinental flights. For very short distances (under 10 km), the simpler flat-Earth approximation (Pythagorean theorem on degree differences) also works adequately.
  • Great-circle routes: aircraft follow great-circle routes (the shortest distance on a sphere) rather than straight lines on a map. This is why transatlantic flights from New York to London fly north over Canada and Greenland rather than straight east across the Atlantic.
  • GPS coordinates: always input coordinates as decimal degrees (e.g., 40.7128, -74.0060) rather than degrees-minutes-seconds. West longitudes and south latitudes are negative values.
  • Earth is not a perfect sphere: it is an oblate spheroid (flattened at poles). The Vincenty formula uses this ellipsoidal shape and is more accurate than Haversine for very precise calculations, differing by up to 0.5% on antipodal distances.
  • Location privacy: when using any online distance calculator, be aware that entering specific addresses reveals your location. Use general coordinates (city centre) rather than specific addresses for privacy-sensitive queries.

Who Uses This Calculator

Travellers planning trips estimate journey distances between cities. Logistics companies calculate optimal delivery routes and service area radii. Real estate analysts measure property distances to schools, transport, and amenities. Developers building location-based apps use geospatial distance calculations for proximity search. Students solve coordinate geometry distance problems. Emergency services calculate response radii and resource positioning. Scientists measure distances between sampling locations in field research.

Optimised for: USA · Canada · UK · Australia · Calculations run in your browser · No data stored

Frequently Asked Questions

What is the distance formula?

d = √[(x₂-x₁)² + (y₂-y₁)²]. For points (1,2) and (4,6): d = √(9+16) = √25 = 5.