Home › How to Calculate the Distance Between Two Points
How to Calculate the Distance Between Two Points
Two points, one distance — and yet the answer is never a single number until you say what kind of distance you mean. The distance between two points on a sheet of graph paper, on a road map, between two cities, or between two GPS coordinates are four different problems, and each has its own method. This guide works through all of them: the flat-grid formula you can do with a pencil, the haversine formula that turns latitude and longitude into miles, the scale-bar method for paper maps, and the tool-based method for real journeys. Every method below is worked with real numbers, so you can follow along and check your own sums against the answers given. In other words, you will learn how to calculate distance between two points whether they are on graph paper, on a map, or given as GPS coordinates.
First, decide which distance you actually need
Before reaching for any formula, name the number you are after. A straight-line distance — “as the crow flies” — is the shortest path over the Earth’s surface between two points, and it is the number airlines, radio planners and delivery-zone designers care about. A driving distance follows the road network, so it is always longer: a pair of cities 585 miles apart in a straight line can easily be 820 miles by road, because roads bend around mountains, rivers and other towns. A travel time is different again, because it depends on speed limits, traffic and stops as well as distance. Mixing these up is the most common distance mistake there is — people quote a straight-line figure as though it were a drive, then wonder why the journey takes five hours longer than they expected.
On this site the two are always shown side by side: the distance calculator gives you the straight-line figure and the driving figure for the same pair, so you can see the gap for yourself. If you only need one of them, say so before you start calculating; the rest of this guide is organised so you can jump straight to the method that matches your problem.
Method 1: The distance formula on a flat grid
When two points sit on a flat surface — a graph, a floor plan, a small-scale map, a game board — the distance between them comes from Pythagoras’ theorem. If the points are (x₁, y₁) and (x₂, y₂), the distance is the square root of (x₂ − x₁)² + (y₂ − y₁)². The idea is simple geometry: the horizontal gap and the vertical gap form the two short sides of a right-angled triangle, and the distance you want is the hypotenuse. This is the formula behind Euclidean distance, and it is exact on any truly flat plane.
Worked example: suppose two points on a printed trail map are at grid positions A(3, 4) and B(11, 10), and each grid square represents 5 miles. First find the differences: the horizontal gap is 11 − 3 = 8 units and the vertical gap is 10 − 4 = 6 units. Square them: 8² = 64 and 6² = 36. Add them: 64 + 36 = 100. Take the square root: √100 = 10 grid units. Finally multiply by the scale: 10 × 5 miles = 50 miles. The 8–6–10 triangle is a doubled 3–4–5 triangle, which is why the numbers come out so cleanly — but the method works for any numbers at all, including ugly ones; you simply end with a square root that does not simplify.
The same calculation runs in reverse, too: if you know the distance and one coordinate, you can find the range of possible positions for the other point, which is how the radius calculator draws a circle of everywhere within a given distance of a place.
One warning: this formula is only trustworthy while the surface is effectively flat. Over a neighbourhood, a town, or even a small county, the Earth’s curvature is negligible and the flat formula is fine. Stretch it across a state or a country, though, and the error grows — a degree of longitude is about 69 miles wide at the equator and shrinks to nothing at the poles, so treating latitude and longitude as flat-grid coordinates quietly distorts every answer. For anything larger than a local area, use the spherical method in the next section instead.
Method 2: The haversine formula for latitude and longitude
Real places are located by latitude and longitude, which are angles on a sphere, not positions on a flat grid. The standard way to turn two coordinate pairs into a distance is the haversine formula, which computes the great-circle distance — the shortest path over the surface of a sphere. For two points with latitudes φ₁, φ₂ and longitudes λ₁, λ₂, all in radians, and R the Earth’s mean radius (3,958.8 miles or 6,371 km):
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
c = 2 · atan2(√a, √(1−a))
d = R · c
It looks forbidding, but each line has one job: the first builds a value from the latitude and longitude differences, the second turns it into the angle between the two points as seen from the Earth’s centre, and the third converts that angle into miles by multiplying by the radius. You never need to memorise it — the calculator on this site runs it instantly — but working it once by hand shows exactly what is going on.
Worked example: Denver, Colorado sits at 39.7392° N, 104.9903° W, and Phoenix, Arizona at 33.4484° N, 112.0740° W. Convert the differences to radians: Δφ = −0.1098 and Δλ = −0.1236. The north–south term is sin²(Δφ/2) ≈ 0.003011. The east–west term is cos(39.7392°) · cos(33.4484°) · sin²(Δλ/2) ≈ 0.7690 × 0.8344 × 0.003816 ≈ 0.002449. Adding them gives a ≈ 0.005459. Then c = 2 · atan2(√0.005459, √0.994541) ≈ 2 · atan2(0.0739, 0.9973) ≈ 0.1479 radians. Finally, d = 3,958.8 × 0.1479 ≈ 585.5 miles (942.3 km).
That is the straight-line figure, and it matches the Denver to Phoenix distance on this site exactly — a useful cross-check, since the same formula powers every straight-line result here. Notice the sign handling: both differences were negative, but the formula only ever squares them or feeds them to functions that handle the sign, so the direction of travel never affects the answer. If you want the same pair by road, the driving figure is 820.6 miles — nearly 40% longer — which is precisely why the two numbers must never be quoted interchangeably.
Accuracy is good enough for almost everything: modelling the Earth as a sphere introduces at most about 0.3–0.5% of error, and typically far less. The limiting factor in practice is usually the coordinates themselves — a city-centre point and a city-boundary point can differ by several miles, which is why published straight-line figures for the same pair sometimes disagree slightly. For the concept behind the number, see as the crow flies distance.
Method 3: Measuring distance on a paper map
On a printed map there is no formula to run — there is a scale bar, and the method is measurement plus multiplication. Find the scale bar, usually printed near the legend, and read what a length on the page represents on the ground: a bar labelled “0 — 10 — 20 miles” with each segment an inch long means one inch on the page equals ten miles on the ground. Lay a ruler or a strip of paper between the two points, mark the endpoints, then lay the strip against the scale bar and read off the distance. For a winding route, mark the strip at each bend and walk it along the road in stages, adding the segments together.
Worked example: a hiking map is printed at a scale of 1:250,000, which means one unit on the map equals 250,000 of the same units on the ground — so 1 cm on the map is 2.5 km on the ground. You measure 12.4 cm between a trailhead and a lake along the marked trail. Multiply: 12.4 × 2.5 km = 31 km, which is about 19.3 miles.
The arithmetic is trivial; the skill is all in the measuring, and the classic mistakes are all physical ones: measuring the straight line when the route curves, reading the wrong scale bar when a map prints several, and forgetting that a photocopied or resized map no longer matches its printed scale. If a map has been enlarged or shrunk, the printed ratio is wrong — but a graphic scale bar printed on the same page scales with the image, which is why survey maps prefer bar scales over written ratios. For the same job done digitally, the map distance calculator lets you click two points on a live map and reads the distance off for you, with no ruler required.
Method 4: Driving distance and flight time for real journeys
For a real journey, the number you need comes from the road network or the flight path, not from a formula. Driving distance is computed by a routing engine that traces actual roads — the same kind of engine that powers the driving figure on this site, which follows the fastest sensible route between the two points and reports both the distance and the driving time. Flight time starts from the straight-line distance and divides by a typical cruising speed: at 500 mph plus about 30 minutes for climb, descent and taxiing, a 585-mile hop works out to roughly 1 hour 40 minutes in the air. These two figures answer different questions, and a good trip plan needs both: the driving number tells you whether the trip is a day’s drive, and the flight number tells you whether flying is worth the airport time at each end.
The practical way to calculate distance between two points is to use a tool rather than a formula: type the two places into the distance calculator, and it returns the straight-line distance, the driving distance and time, and the flight estimate together.
If you want the driving figure on its own — say, to compare two possible routes or to cost out fuel — the driving distance calculator gives the road distance and drive time for any pair of places. For planning around a single starting point rather than a pair, the radius calculator shows everything within a chosen distance of one place, which is the right tool for “what is within an hour’s drive of here?” rather than “how far is A from B?”. The worked figures in the methods above are the same ones these tools produce, so you can use the calculator to check your hand calculation — or use your hand calculation to check the calculator.
Converting units and checking your answer
Distance answers arrive in miles or kilometres depending on who is asking, and converting between them is the last step of almost every calculation. One mile is exactly 1.609344 km, and one kilometre is 0.621371 miles. To convert miles to kilometres, multiply by 1.609344; to convert kilometres to miles, multiply by 0.621371 (or divide by 1.609344). Our Denver to Phoenix example converts as 585.5 × 1.609344 ≈ 942.3 km, and the paper-map example converts as 31 km × 0.621371 ≈ 19.3 miles. Rounding to one decimal place is plenty for travel figures — nobody plans a journey to the nearest yard. The method you use to calculate distance between two points stays the same in either unit — only the conversion at the end changes.
Before trusting any answer, run two sanity checks. First, the rough scale check: one degree of latitude is about 69 miles everywhere on Earth, so if two places differ by 6 degrees of latitude, the straight-line distance must be at least roughly 400 miles — if your formula says 40, a decimal point has slipped.
Second, the ordering check: for any pair of places, the driving distance must be longer than the straight-line distance, and the flight distance should be within a few percent of the straight-line figure. If your driving number comes out shorter than the straight-line number, something is wrong — usually the two figures were swapped, or one of them was measured to a different endpoint, such as an airport instead of a city centre. These two checks catch the overwhelming majority of distance errors before they reach a plan, a quote or a timetable.
Mistakes that quietly wreck the answer
Most distance errors are not arithmetic slips — they are the same handful of setup mistakes, made before the calculation even starts. Feeding degrees into a formula that expects radians is the classic one: the haversine formula’s trigonometric functions work in radians, and skipping the conversion (multiply degrees by π/180) produces answers that are wrong by a factor of about 57. Swapping latitude and longitude is the second — coordinates are usually quoted latitude first, but many data files list longitude first, and a swapped pair often still produces a plausible-looking number for a point in the middle of an ocean. Using the diameter instead of the radius doubles every answer; it sounds too silly to happen and happens constantly when constants are copied carelessly. Measuring the straight line when the question is about the road understates a journey by 20–40% on typical American city pairs. Mixing endpoints is the quietest of all: measuring from a city centre at one end and an airport at the other adds or subtracts ten miles without any warning, which is why published figures for the same pair can disagree.
Trusting a resized paper map’s printed ratio — covered above — silently scales every measurement. If you are pulling coordinates from an address rather than a map, the latitude and longitude finder returns them in the right order and format to paste straight into a calculation, which removes two of these mistakes at a stroke.
Frequently asked questions
What is the easiest way to calculate distance between two points?
For most people, the easiest way is to type the two places into a distance calculator, which returns the straight-line distance, the driving distance and the flight estimate in one go. If you want to understand or verify the number, use the flat-grid formula for points on a map or plan, and the haversine formula for latitude and longitude coordinates. The calculator and the formulas agree — they are the same mathematics, one done by hand and one done by software — so either route gives you the same answer, and using both is the best way to catch a mistake.
How do I calculate distance between two points on Google Maps?
On a computer, right-click the starting point and choose “Measure distance”, then click the destination; Google draws the line and shows the straight-line distance, and you can add further clicks to trace a route. For a driving distance, search for directions between the two places instead, which follows the roads and reports both the distance and the travel time. Keep the two results separate: the measure-distance tool gives you the as-the-crow-flies figure, while directions give you the road figure, and the road figure is always the longer of the two.
What is the formula for the distance between two coordinates?
For coordinates on a flat grid, the distance formula is √((x₂ − x₁)² + (y₂ − y₁)²), which is Pythagoras’ theorem applied to the horizontal and vertical gaps. For latitude and longitude, use the haversine formula: a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), c = 2 · atan2(√a, √(1−a)), and d = R · c, with R = 3,958.8 miles. The flat formula is exact on a plane and wrong on a sphere; the haversine formula is exact on a sphere and unnecessary on a plane — choose by the size of the area you are measuring.
How accurate is the haversine formula?
Very accurate for everyday purposes: because it models the Earth as a perfect sphere rather than the slightly squashed spheroid it really is, its answers can differ from a full geodesic calculation by up to roughly 0.3–0.5% in the worst orientations, and typically far less. For trip planning, flight estimates, radius zones and delivery areas, that is well inside the noise of the other assumptions involved. Only surveying, precise navigation and scientific geodesy need the heavier ellipsoidal mathematics; everyone else can use the haversine with confidence.
Why is the driving distance longer than the straight-line distance?
Because roads do not follow the shortest path over the Earth’s surface: they bend around mountains, rivers, lakes and other towns, follow valley floors, and join highways that may run in the “wrong” direction for part of the journey. On typical American city pairs the driving distance runs 20–40% longer than the straight-line distance — Denver to Phoenix is 585.5 miles as the crow flies but 820.6 miles by road. The straighter and flatter the terrain between two places, the closer the two figures get; the more the route has to detour, the wider the gap becomes.
Can I calculate distance without knowing the coordinates?
Yes. If you know the place names, a distance calculator or a mapping service will find the coordinates for you — you only need the names of the two places. If you have a paper map, measure with a ruler against the scale bar as described above. And if you have the two points marked on any gridded plan, count the grid squares between them and apply the flat-grid formula. Coordinates are simply the most precise way of naming a point; any reliable way of locating the two points is enough to measure the distance between them.
Published December 2, 2026 · Try the distance calculator or browse the tools.