Distance Formula Calculator
Find the straight-line distance between two points on the coordinate plane, plus the midpoint between them. Enter the two sets of coordinates and the calculator applies the distance formula and shows the horizontal and vertical differences.
Enter Values
How to use this calculator
- Enter the first point as x1, y1 and the second point as x2, y2 (any real numbers).
- Read the distance, the horizontal difference dx, the vertical difference dy, and the midpoint coordinates.
- Use the step-by-step working to see how the Pythagorean calculation is built up.
How it works
The distance formula is the Pythagorean theorem: the horizontal difference dx = x2 − x1 and vertical difference dy = y2 − y1 form the two legs of a right triangle, and the distance is the hypotenuse, d = √(dx² + dy²). The midpoint is the average of the coordinates, ((x1 + x2)/2, (y1 + y2)/2). Distance is always non-negative and is zero only when the points coincide.
Worked example
Worked example. For (0, 0) and (3, 4): dx = 3, dy = 4, so d = √(3² + 4²) = √25 = 5. The midpoint is ((0 + 3)/2, (0 + 4)/2) = (1.5, 2).
Common mistakes
- Forgetting to square the differences before adding them — d is not simply dx + dy.
- Dropping a negative sign; squaring handles the sign, but the differences themselves can be negative.
- Mixing up which coordinate is x and which is y when entering the points.
Frequently asked questions
Does the order of the two points matter?
No. Swapping the points flips the sign of dx and dy, but squaring removes the sign, so the distance and midpoint are unchanged.
Can the distance be negative?
No. A distance is a length, so it is always zero or positive. It equals zero only when both points are the same.
Related tools
- Interpolation Calculator (Linear)
- Extrapolation Calculator
- Coordinate Geometry Calculator
- Polygon Interior Angle Calculator
- Line Intersection Calculator
- Angle Sum Calculator
Explore more in Maths, Education & Science.
Tip: Enter any known values to calculate the remaining results.
All calculations run in your browser. Your inputs are never saved or transmitted.



