Distance Between Coordinates Calculator (Lat/Long)

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free calculator for the distance between coordinates. Enter two latitude and longitude points for the great-circle distance in km, miles and nautical miles.

Miles
0
Nautical miles
0
Initial bearing
0
Midpoint
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the latitude longitude distance calculator

  1. Enter the latitude and longitude of the first point in decimal degrees. North and east are positive; south and west are negative. London is about 51.5074, −0.1278.
  2. Enter the latitude and longitude of the second point. New York is about 40.7128, −74.0060.

The calculator shows the distance between coordinates in kilometres, miles and nautical miles, the initial bearing from the first point to the second, and the midpoint along the great-circle route.

If your coordinates are in degrees, minutes and seconds, convert them first with the DMS to decimal converter.

How the distance between coordinates is calculated

The shortest path between two points on a sphere follows a great circle: a circle whose centre is the centre of the Earth, like the equator or any line of longitude. The calculator uses the haversine formula to find the length of that path:

a = sin²(Δφ ÷ 2) + cos φ₁ × cos φ₂ × sin²(Δλ ÷ 2)

distance = 2R × atan2(√a, √(1 − a))

Here φ is latitude, λ is longitude, Δ means the difference between the two points, and R is the Earth's mean radius, 6,371 km. The haversine formula is well suited to computers because it stays accurate for short distances, where some other formulas lose precision.

With the default coordinates, the distance between London and New York comes out at about 5,570 km, 3,461 miles or 3,008 nautical miles.

How accurate is it?

The Earth isn't a perfect sphere: it's slightly flattened at the poles, with an equatorial radius of about 6,378 km and a polar radius of about 6,357 km. Treating it as a sphere introduces an error of up to about 0.5%, depending on where the points are and the direction between them. For most purposes, such as estimating travel distances, comparing locations or planning, that's more than accurate enough. For surveying, aviation and other precise work, ellipsoidal methods such as Vincenty's formulae or the algorithms of Charles Karney, based on the WGS 84 model of the Earth, are used instead.

Also remember that the distance between coordinates is a straight line over the Earth's surface, often described as "as the crow flies". Road, rail and shipping routes are longer, often by 20% or more, because they follow terrain, coastlines and networks.

The initial bearing

The bearing is the compass direction from the first point towards the second, measured clockwise from true north: 0° is north, 90° east, 180° south and 270° west. For London to New York, the initial bearing is about 288°, roughly west-north-west.

On a great circle route, the bearing usually changes along the way, except when travelling due north, due south or along the equator. That's why the calculator calls it the initial bearing. Flights from London to New York head north-west at first, curve over the North Atlantic and arrive heading south-west. On a flat map, the route looks curved, but on a globe it's the shortest path.

The midpoint

The midpoint is the point halfway along the great-circle route. For London and New York, it's about 52.37° N, 41.29° W, over the North Atlantic. Note that it's further north than either city. That's because the great circle bulges towards the pole compared with a straight line on a flat map.

A worked example

Find the distance between Dhaka (23.8103, 90.4125) and Chittagong (22.3569, 91.7832) in Bangladesh.

  1. Distance: about 214 km, or about 132.9 miles.
  2. Nautical miles: about 115.5.
  3. Initial bearing: about 138.8°, south-east.
  4. Midpoint: about 23.0851, 91.1016.

The road distance between the two cities is considerably longer, because the highway doesn't follow a straight line. Enter these coordinates in the calculator to check.

A longer example: from Sydney (−33.8688, 151.2093) to Tokyo (35.6762, 139.6503), the distance is about 7,826 km, with an initial bearing of about 350°, almost due north. The midpoint is close to the equator.

Units of distance

  • Kilometres are the standard unit in most of the world.
  • Miles (statute miles) are used for road distances in the US and UK. One mile is 1.609344 km.
  • Nautical miles are used in aviation and at sea. One nautical mile is exactly 1,852 metres, originally based on one minute of latitude. Speeds in knots are nautical miles per hour.

Who uses a latitude longitude distance calculator

Developers use it to check distance calculations in apps, such as store locators and delivery zones. Travellers and pilots use it to estimate flight distances. Logistics and field service businesses use it to estimate travel between sites. Researchers and students use it in geography, ecology and data analysis. Local businesses use it to work out service areas and how far customers travel.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.

Latitude and longitude basics

Latitude measures how far north or south a point is from the equator, from −90° at the South Pole to 90° at the North Pole. Longitude measures how far east or west it is from the prime meridian through Greenwich, London, from −180° to 180°. One degree of latitude is always about 111 km. One degree of longitude is about 111 km at the equator but shrinks towards the poles, to about 55.7 km at 60° latitude, because lines of longitude converge. That's why you can't simply use the Pythagorean theorem on raw coordinates over long distances.

Precision of coordinates

The number of decimal places in a coordinate determines how precisely it locates a point. Four decimal places pin a location to about 11 metres; five to about 1.1 metres; six to about 11 centimetres. Two decimal places, by contrast, only locate a point to about 1.1 km. Coordinates copied from mapping apps usually have six or more decimals, which is far more precise than the haversine formula's own accuracy.

Distance in spreadsheets and code

The haversine formula is easy to implement. In a spreadsheet, convert degrees to radians with the RADIANS function, then build the formula step by step. In code, most languages have the trigonometric functions needed, and many mapping libraries include a ready-made distance function. Whichever you use, test it against a few known distances, such as the ones in this article, to make sure the signs and units are right.

Common mistakes

  • Mixing up latitude and longitude. Latitude comes first in most conventions.
  • Forgetting the minus sign for south latitudes and west longitudes.
  • Entering degrees, minutes and seconds as if they were decimals. 40°42′ is 40.7°, not 40.42°.
  • Expecting road distances. The result is the shortest distance over the Earth's surface.

Finding the distance between coordinates on a map

To get coordinates for a place, right-click it in most online mapping services, or long-press it on a phone, and the latitude and longitude appear. Copy them in decimal form and paste them into the calculator. When you need the distance between coordinates for many pairs, such as every customer's distance from a warehouse, it's quicker to use a spreadsheet or a short script with the haversine formula, then check a few results with this calculator.

Short distances

For short distances, a few kilometres or less, the curvature of the Earth hardly matters, and a flat approximation works well. Multiply the difference in latitude by about 111.2 km per degree, multiply the difference in longitude by 111.2 km × cos(latitude), and combine them with the Pythagorean theorem. The haversine formula gives the same answer at short range and stays correct at long range, so the calculator uses it for every distance between coordinates.

Distance and time

Once you know the distance between coordinates, you can estimate travel time. A commercial jet cruising at about 900 km/h covers the 5,570 km from London to New York in a little over six hours in still air, although winds, routing and take-off and landing add or subtract time. The speed, distance and time calculator does the arithmetic.

Distance between coordinates and the antipode

The longest possible great-circle distance between two points on Earth is half the circumference, about 20,015 km, between a point and its antipode, the point directly opposite on the globe. To find a place's antipode, change the sign of the latitude and add or subtract 180° from the longitude. For example, the antipode of 40° N, 74° W is 40° S, 106° E, which lies in the Indian Ocean south-west of Australia. Enter both in the calculator and the distance between coordinates comes out at about 20,015 km.

Sources and further reading

Frequently asked questions

How do I calculate the distance between coordinates?

Use the haversine formula with the Earth's mean radius, 6,371 km, as this calculator does.

Is the result the driving distance?

No. It's the shortest distance over the Earth's surface. Road distances are longer.

How accurate is the haversine formula?

Within about 0.5% of precise ellipsoid methods, because it treats the Earth as a sphere.

What is the initial bearing?

The compass direction from the first point towards the second at the start of the route.

How do I enter southern or western coordinates?

Use negative numbers: south latitudes and west longitudes are negative.

Is the latitude longitude distance calculator free?

Yes. It's free, needs no sign-up, and works in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep