General Math
Distance Formula Calculator: Distance Between Two Points
Learn the distance formula, how it derives from the Pythagorean theorem, and how to find the distance and midpoint between two coordinates.
Try it now
Distance Formula Calculator
Calculate the distance between two points on a coordinate plane.
Distance Formula Calculator: Distance Between Two Points
How far apart are two points on a graph? The distance formula answers that question exactly, using nothing more than the coordinates of the two points. It is a cornerstone of coordinate geometry and flows directly from one of the most famous results in mathematics — the Pythagorean theorem. A distance formula calculator computes the distance and the midpoint for you in an instant.
The Distance Formula
For two points (x₁, y₁) and (x₂, y₂), the distance d between them is:
d = √((x₂ − x₁)² + (y₂ − y₁)²)
The horizontal gap (x₂ − x₁) and the vertical gap (y₂ − y₁) form the two legs of a right triangle, and the straight-line distance between the points is the hypotenuse.
Why It Works: The Pythagorean Connection
The Pythagorean theorem states that in a right triangle, a² + b² = c². In the coordinate plane:
- The horizontal leg has length Δx = x₂ − x₁.
- The vertical leg has length Δy = y₂ − y₁.
- The distance d is the hypotenuse, so d² = Δx² + Δy², and therefore d = √(Δx² + Δy²).
Squaring the differences also conveniently removes any negative signs, so the order in which you subtract does not affect the answer.
A Worked Example
Find the distance between (1, 2) and (4, 6):
- Δx = 4 − 1 = 3
- Δy = 6 − 2 = 4
- d = √(3² + 4²) = √(9 + 16) = √25 = 5
This is the classic 3-4-5 right triangle.
The Midpoint Formula
The calculator also gives the midpoint — the exact centre of the segment joining the two points:
Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
For the example above, the midpoint is ((1 + 4)/2, (2 + 6)/2) = (2.5, 4).
How to Use the Distance Formula Calculator
- Enter the coordinates of the first point, (x₁, y₁).
- Enter the coordinates of the second point, (x₂, y₂).
- The calculator returns the distance, the midpoint, and the horizontal and vertical differences.
Where the Distance Formula Is Used
- Navigation and mapping: straight-line (“as the crow flies”) distances.
- Computer graphics and games: collision detection and movement.
- Physics and engineering: displacement between positions.
- Data science: Euclidean distance is a core measure of similarity between points.
Extending to Three Dimensions
The same idea extends naturally to 3D space by adding a z-term:
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
This is used in 3D modelling, physics simulations, and machine learning.
Common Mistakes to Avoid
- Forgetting to square the differences. Both gaps must be squared before adding.
- Adding before squaring. You cannot compute (Δx + Δy)² — the terms are squared separately.
- Taking the square root of each term individually. √(a² + b²) is not a + b.
- Sign confusion. Because the differences are squared, the subtraction order does not matter — but be consistent anyway.
Conclusion
The distance formula turns two pairs of coordinates into the exact straight-line distance between them, and it is really just the Pythagorean theorem in disguise. Paired with the midpoint formula, it gives you a complete picture of the segment between any two points. A distance formula calculator handles the squaring and the square root instantly.
Try our free Distance Formula Calculator for instant results.
OurDailyCalc Team
OurDailyCalc — beautiful tools for everyday calculations.