Distance Formula Calculator
Compute the straight-line distance between two points (x₁, y₁) and (x₂, y₂) with the Euclidean distance formula. Includes a 3-4-5 example and common mistakes.
Results
Distance
You might also need
Educational estimates · not financial advice · free, no signup
Formula / how it works
d = √((x₂ − x₁)² + (y₂ − y₁)²). This is the Pythagorean theorem applied to the horizontal and vertical differences between the points.
Detailed guide
What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.
What this calculator is
The distance formula gives the straight-line distance between two points on a coordinate plane. It is the Pythagorean theorem in disguise: the horizontal difference and the vertical difference are the two legs of a right triangle, and the distance is the hypotenuse. Students use it in algebra and geometry, game developers use it for collision and range checks, and mappers use it for flat-plane approximations. For distances on the Earth's surface over long ranges, the plane formula is not accurate; use a great-circle distance instead.
When to use / who it helps
- You need the length of a segment between two coordinate points.
- You are checking whether a point lies within a radius of another.
- You are solving geometry or analytic geometry homework.
- You are measuring distance between points on a flat map or grid.
- You want a quick verification of a calculation on paper.
How to use
Steps
- Enter x₁ and y₁ for the first point.
- Enter x₂ and y₂ for the second point.
- Read the distance.
- Use the same units for all coordinates; the result is in those units.
- Square roots of non-perfect squares will be decimals.
- For 3D points, add the (z₂ − z₁)² term by hand.
How to interpret results
- The result is never negative and equals zero only if the points coincide.
- Swapping the points gives the same distance.
- Distance is a straight line, not the route along roads or grid steps.
- For grids where you move only horizontally and vertically, Manhattan distance is different.
- If coordinates are latitude and longitude, the flat formula misrepresents real distances.
Common mistakes & gotchas
- Forgetting to square the differences or the square root at the end.
- Pairing the wrong coordinates, for example subtracting x₁ from y₂. The order of the two points does not matter because of the squares, but x must be paired with x and y with y.
- Using the formula on geographic coordinates.
- Mixing units between x and y.
- Rounding before taking the square root.
Worked example
Worked example — from (0, 0) to (3, 4), and from (−2, 3) to (4, −1)
- Differences: 3 − 0 = 3 and 4 − 0 = 4.
- Squares: 9 + 16 = 25; square root = 5.
- Second pair: differences 4 − (−2) = 6 and −1 − 3 = −4.
- Squares: 36 + 16 = 52; square root ≈ 7.2111.
Result: The first distance is exactly 5; the second is about 7.211 units.
To load the form's own demo values, tap Try example above the Calculate button.
How to calculate / formula
d = √((x₂ − x₁)² + (y₂ − y₁)²). This is the Pythagorean theorem applied to the horizontal and vertical differences between the points.
Frequently asked questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²).
How is it related to the Pythagorean theorem?
The differences in x and y form the legs of a right triangle, and the distance is the hypotenuse.
Can I use it in three dimensions?
Yes, add (z₂ − z₁)² under the square root.
Does the order of points matter?
No. The squares remove the sign.
Is it valid for latitude and longitude?
Only for small areas. Use a great-circle formula for larger distances.
What is Manhattan distance?
The sum of absolute differences |x₂ − x₁| + |y₂ − y₁|, used when you can only move along a grid.