Distance formula calculator
The distance formula gives the straight-line (Euclidean) distance between any two points (x₁, y₁) and (x₂, y₂) in a coordinate plane.
Distance
—
Midpoint
—
Slope
—
Formula
d = √((x₂ - x₁)² + (y₂ - y₁)²)
This is the Pythagorean theorem applied to the horizontal and vertical legs of the right triangle formed by the two points.
Example
Points A = (0, 0) and B = (3, 4):
d = √(3² + 4²) = √(9 + 16) = √25 = 5
Midpoint = (1.5, 2).
Frequently asked
What is the distance formula?
Distance = √((x₂-x₁)² + (y₂-y₁)²). It is derived from the Pythagorean theorem: the horizontal distance dx and vertical distance dy form the two legs of a right triangle, and the straight-line distance is the hypotenuse.
What is the midpoint formula?
Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). The midpoint is exactly halfway between the two points.
What if both points are the same?
Distance = 0 and the midpoint equals that single point.
Does this work with negative coordinates?
Yes. Squaring the differences removes sign, so negative coordinates work correctly.
How do I share my calculation?
Click "Share with my numbers" to copy a URL that saves all four coordinates.