Home/Calculators/Math/Distance Formula Calculator

Distance Formula Calculator

Find the distance between two points on a plane — instant and free.

distance-formula-calculator
Result
—
In summary: The distance between two points is d = √((x2 − x1)² + (y2 − y1)²). For (1, 2) and (4, 6), d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5 units.

How the distance formula works

The distance formula is the Pythagorean theorem applied to coordinates: d = √((x2 − x1)² + (y2 − y1)²). For points (1, 2) and (4, 6), d = √(3² + 4²) = √(9 + 16) = √25 = 5 units. The steepness of that same line comes from the slope calculator.

To see why, draw a right triangle with the segment as its hypotenuse: one leg runs horizontally Δx = x2 − x1, the other vertically Δy = y2 − y1. Pythagoras then gives d² = Δx² + Δy².

How to use this calculator

Enter two points as (x1, y1) and (x2, y2). The calculator squares the horizontal and vertical gaps, adds them, and takes the square root — the straight-line distance. To measure the boundary of a shape instead, use the perimeter calculator.

Keep the coordinates paired correctly: mixing x1 with y2 is the commonest slip. If the two points share an x value the distance is simply the vertical gap.

Worked example

From (1, 2) to (4, 6): Δx = 3, Δy = 4, so d = √(9 + 16) = √25 = 5. This is the classic 3-4-5 right triangle.

Most coordinate pairs give an irrational decimal instead. Note also that this is the straight-line, or Euclidean, distance: if movement is restricted to a city grid you would add Δx and Δy, giving 3 + 4 = 7 rather than 5. The formula is the Pythagorean theorem in disguise: the distance is the hypotenuse of a right triangle, which the hypotenuse calculator finds from the two legs.

Frequently asked questions

What is the distance formula?
d = √((x2 − x1)² + (y2 − y1)²) — the square root of the squared horizontal gap plus the squared vertical gap.
What is the distance between (1, 2) and (4, 6)?
5 units, because √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5.
Is the distance formula the same as Pythagoras?
Yes — it is the Pythagorean theorem where the horizontal and vertical differences are the two legs of a right triangle.
Can the distance be negative?
No. Distance is always zero or positive because the differences are squared before the square root.
Does the order of the two points matter?
No — swapping the points gives the same answer. Reversing them flips the sign of Δx and Δy, but squaring removes the sign, so d is unchanged. Only the reported Δx and Δy in the badge change sign, which tells you the direction of travel.
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: July 27, 2026 · Calculations run in your browser. Estimates for information only.