2D Distance Calculator

This 2D distance calculator finds the straight-line distance between two points (x₁, y₁) and (x₂, y₂) on a plane. It uses the distance formula, which is just the Pythagorean theorem applied to the horizontal and vertical gaps between the points: Distance = √[(x₂ − x₁)² + (y₂ − y₁)²]. Enter the coordinates of both points to get the exact length of the segment joining them.

Formula

Distance = √[(x₂-x₁)² + (y₂-y₁)²]
  • The distance formula is the Pythagorean theorem: the gap in x and the gap in y are the two legs of a right triangle, and the distance is the hypotenuse.
  • Formula: Distance = √[(x₂ − x₁)² + (y₂ − y₁)²].
  • Because the differences are squared, the order of the points does not matter - the distance from A to B equals the distance from B to A.
  • Use the same unit for every coordinate; the distance then comes out in that same unit.
  • If the two points are identical the distance is 0, and the result is never negative.

Example Calculation

Inputs
  • X1: 0
  • Y1: 0
  • X2: 3
  • Y2: 4

From (0, 0) to (3, 4): the x-gap is 3 and the y-gap is 4, so the distance is √(3² + 4²) = √(9 + 16) = √25 = 5.

Frequently asked questions

What is the distance formula?
It gives the straight-line distance between two points: Distance = √[(x₂ − x₁)² + (y₂ − y₁)²]. It comes directly from the Pythagorean theorem.
When should I use this calculator?
Use it whenever you have the coordinates of two points and need the straight-line (Euclidean) distance between them - in geometry, graphing, navigation, or game design.
Does the order of the points matter?
No. The differences are squared, so swapping the two points gives exactly the same distance.
What units does the result use?
Whatever unit you use for the coordinates. If x and y are in metres, the distance is in metres.
Can the distance be negative?
No. A distance is a length, so it is always zero or positive. It is zero only when the two points coincide.