CalculatorPro Tools

How to Calculate Distance Between Two Points

The distance formula looks like one line and has one trap inside it. Square the differences, not the points, and add them before the square root.

Skip the manual math. Enter your numbers and get the answer instantly.

Try the Distance Calculator

The Two Dimensional Formula

The distance equals the square root of the horizontal change squared plus the vertical change squared. Written out, the square root of (x2 minus x1) squared plus (y2 minus y1) squared. The differences are squared individually before being added.

Why Squaring Is Necessary

Adding the changes and then squaring gives a completely different answer. For 3,4 the correct answer is the square root of 25, which is 5, whereas adding first gives 7 squared, which is 49. The squaring is what encodes the right angled triangle.

Three Dimensions

Add a third squared term for the change in z. The distance from the origin to the point 2, 3, 6 is the square root of 4 plus 9 plus 36, which is the square root of 49, which is exactly 7.

The Midpoint

Average each coordinate independently. The midpoint between 0,0 and 10,20 is 5,10. This works because the midpoint is simply the average position along each axis taken separately.

Flat Space Versus a Sphere

This formula is correct for flat Cartesian space such as a plan, a screen or a small area. For long distances across the Earth's surface, the curvature matters and a great circle calculation is required instead.

Straight Line Versus Real Journey

The straight line is always the shortest possible path and is a lower bound. Roads, rivers, buildings and terrain all add distance, so treat the figure as a comparison tool rather than a journey estimate.

Worked Example

From 0,0 to 3,4: the changes are 3 and 4, squared give 9 and 16, which sum to 25, and the square root of 25 is exactly 5.

Calculate It Now

Last updated: · by CalculatorPro Tools