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
—
Saved to favorites
Your favorites are on the home page under “Your favorites.” They are saved only in this browser on this device, so they will not appear on another device or browser. No account, no server.
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).
References
- Euclidean distance (Pythagorean distance formula)Wikipedia · en.wikipedia.org
- Distance between two points (2D/3D/n-D)Wolfram MathWorld · mathworld.wolfram.com
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.
Embed this calculator
Add this free calculator to your own site. Copy the snippet — it works anywhere you can paste HTML, and stays in sync with this page.