Distance Calculator: Distance Between Two Points

Find the distance between two points on a graph in 2D or 3D, with the exact answer and midpoint. Or enter the latitude and longitude of two places for the straight-line distance between them. For the line through two points, use the Slope Intercept Form Calculator.

Your details

Points
Your distanceDistance
5
Exact form
5
Δx
3
Δy
4
Midpoint
(5/2, 4)
Working
d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5

Map distance is straight-line (as the crow flies) on a round Earth, not driving distance.

How the distance is calculated

The distance formula is Pythagoras: the gaps along each axis are the sides, and the distance is the hypotenuse.

d = √((x₂ − x₁)² + (y₂ − y₁)²)

  • Find the gap along each axis: Δx = x₂ − x₁ and Δy = y₂ − y₁.
  • Square each gap, add them, and take the square root.
  • In 3D, add the z gap too: d = √(Δx² + Δy² + Δz²).
  • The midpoint is the average of each coordinate: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
  • For places on a map, the haversine formula finds the great-circle distance over the curved Earth, radius 6,371 km.

Worked example — From (1, 2) to (4, 6): Δx = 3 and Δy = 4, so d = √(9 + 16) = √25 = 5. The midpoint is (5/2, 4).

Things to consider

  • Type fractions like 1/2 or −3/4. The answer stays exact where it can.
  • The order of the points does not change the distance.
  • For map coordinates, south latitudes and west longitudes are negative.
  • An answer like 5√2 is exact. The decimal beside it is rounded.

Frequently asked questions

What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (4, 6) it gives √25 = 5.

How does the distance formula relate to Pythagoras?

Draw a right triangle with the two points at the ends of the hypotenuse. The sides are Δx and Δy, so a² + b² = c² gives the distance.

How do I find the distance between two points in 3D?

Add the z gap under the square root: d = √(Δx² + Δy² + Δz²). From (0, 0, 0) to (2, 3, 6) it is √49 = 7.

How do I find the midpoint of two points?

Average each coordinate. The midpoint of (1, 2) and (4, 6) is (5/2, 4). For the line joining them, use the Slope Intercept Form Calculator.

How do I find the distance between two latitude and longitude points?

Use the haversine formula, which measures along the curve of the Earth. Melbourne to Sydney is about 713 km in a straight line.

Why is the map distance shorter than the driving distance?

It is the straight-line distance, as the crow flies. Roads bend around terrain and towns, so driving is usually longer.

Results are estimates for general information only, not financial, medical or professional advice.