Distance Formula Calculator
Find the distance between two points on the coordinate plane.
Straight-line distance between the two points.
- 1
Horizontal gap Δx = x₂ − x₁
4 − 1 = 3 - 2
Vertical gap Δy = y₂ − y₁
6 − 2 = 4 - 3
Sum of squares Δx² + Δy²
3² + 4² = 25 - 4
Distance d = √(Δx² + Δy²)
√25 = 5Square root of the sum gives the straight-line distance.
Formula
How this is calculated
The calculator takes the coordinates of two points in a flat 2D plane: the first point (x₁, y₁) and the second point (x₂, y₂). Each value is just a position along the horizontal x-axis or the vertical y-axis, measured in whatever unit you choose — all four coordinates must share that same unit, and the resulting distance comes out in it too.
First it finds the horizontal gap Δx = x₂ − x₁ and the vertical gap Δy = y₂ − y₁. These two gaps are the legs of a right triangle, and the straight-line distance is its hypotenuse. By the Pythagorean theorem it squares each gap, adds them, and takes the square root: d = √(Δx² + Δy²). Squaring removes any negative sign, so the result is always non-negative and the order of the points never changes the answer.
This is Euclidean (as-the-crow-flies) distance, assuming flat, uncurved space and exact coordinates — it does not account for obstacles, road paths, or Earth's curvature. Results are rounded to four decimals, so values that are irrational (like √2) are shown approximately.
Examples
| Input | Result |
|---|---|
| (1, 2) and (4, 6) | d = 5 |
About this calculator
The distance formula gives the straight-line (Euclidean) distance between two points (x₁, y₁) and (x₂, y₂) in the plane. It is a direct application of the Pythagorean theorem: the horizontal gap (x₂ − x₁) and vertical gap (y₂ − y₁) form the legs of a right triangle, and the distance is the hypotenuse.
Because each difference is squared, the order of the points does not matter — swapping them gives the same result. The formula is widely used in geometry, physics, navigation, and computer graphics whenever you need the shortest distance between two locations.
Frequently asked questions
It comes from the Pythagorean theorem. The differences in x and y are the legs of a right triangle, so the distance (hypotenuse) is the square root of the sum of their squares.
No. Each difference is squared, so (x₂ − x₁)² equals (x₁ − x₂)². You get the same distance regardless of which point you call first.
Yes. The formula works for any real coordinates, positive or negative, because the squaring removes any sign before the square root.
Also known as
TG we-Calculate Editorial Team. (2026). Distance Formula Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/distance-formula-calculator
TG we-Calculate Editorial Team. "Distance Formula Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/distance-formula-calculator.
TG we-Calculate Editorial Team, "Distance Formula Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/distance-formula-calculator
@misc{wecalculate_distance_formula_calculator, title = {Distance Formula Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/distance-formula-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
