Distance Formula in Geometry
The distance formula finds the straight-line distance between two points (x₁, y₁) and (x₂, y₂) in the coordinate plane. It is . In words: square the horizontal difference, square the vertical difference, add them, and take the square root. The formula is a direct application of the Pythagorean theorem — the distance is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps between the points.
Interactive distance explorer
Drag point A or B (or use the arrow keys after clicking a point) and watch the distance and its full substitution update. Toggle the right-triangle overlay to see the Pythagorean derivation.
Drag a point, or click it and use the arrow keys. Coordinates snap to the grid.
Step-by-step substitution
- d = √((x₂−x₁)² + (y₂−y₁)²) = √((3−0)² + (4−0)²) = √(9 + 16) = 5
Derivation from the Pythagorean theorem
Drop a horizontal and a vertical line between the two points to form a right triangle. The horizontal leg has length and the vertical leg has length . By the Pythagorean theorem, the hypotenuse — the distance d — satisfies:
Taking the positive square root gives the distance formula. Because both differences are squared, the order of the points doesn’t matter — the distance from A to B equals the distance from B to A.
Worked examples
- (0, 0) to (3, 4): d = √((3−0)² + (4−0)²) = √(9 + 16) = √25 = 5. This is the classic 3-4-5 right triangle.
- (1, 2) to (4, 6): d = √((4−1)² + (6−2)²) = √(9 + 16) = √25 = 5.
- (−2, −3) to (4, 5): d = √((4−(−2))² + (5−(−3))²) = √(6² + 8²) = √(36 + 64) = √100 = 10.
Practice problems
Find the distance between each pair of points, then check your answer.
- (0, 0) and (6, 8)
Answer
√(36 + 64) = √100 = 10
- (2, 1) and (5, 5)
Answer
√(9 + 16) = √25 = 5
- (−1, −1) and (2, 3)
Answer
√(9 + 16) = √25 = 5
- (0, 0) and (5, 12)
Answer
√(25 + 144) = √169 = 13
- (−3, 4) and (3, −4)
Answer
√(36 + 64) = √100 = 10
Related
Classroom use: distance formula formulas
Learning objectives
After using this page, students will be able to:
- Compute the distance between two points from their coordinates.
- Derive the distance formula from the Pythagorean theorem.
- Use distance to test whether a triangle is isosceles or a quadrilateral is a rhombus.
Suggested classroom activity
Drag the points to (0,0) and (3,4) with the right-triangle overlay on, so the legs of 3 and 4 are visible beneath the formula. Then move to points with negative coordinates: the squaring step is what makes sign errors harmless, and seeing that resolves most student anxiety about it.
Standards alignment
| Code | Standard |
|---|---|
8.G.B.8 | Apply the Pythagorean theorem to find the distance between two points in a coordinate system. |
HSG.GPE.B.7 | Use coordinates to compute perimeters and areas of polygons via the distance formula. |
8.G.B.7 | Apply the Pythagorean theorem to find unknown side lengths in right triangles. |
Free to use and adapt in class under the terms on our license page — no account, no sign-up, no ads. Content last reviewed August 2026.
Frequently asked questions
What is the distance formula in geometry?
The distance formula gives the straight-line distance between two points (x₁, y₁) and (x₂, y₂): d = √((x₂ − x₁)² + (y₂ − y₁)²). For (0, 0) and (3, 4), the distance is √(9 + 16) = 5.
How is the distance formula derived?
It comes from the Pythagorean theorem. The horizontal gap |x₂ − x₁| and vertical gap |y₂ − y₁| are the legs of a right triangle, and the distance is the hypotenuse: d² = (x₂ − x₁)² + (y₂ − y₁)².
Is the distance formula the same as the Pythagorean theorem?
They are the same idea. The Pythagorean theorem a² + b² = c² applied to the horizontal and vertical differences between two points gives the distance formula. The distance is the hypotenuse c.
What is the distance formula used for?
It measures how far apart two points are on a coordinate plane — used for lengths of segments, radii, checking congruence, and any problem where you need a straight-line distance from coordinates.