Distance Formula Calculator
Enter the coordinates of two points and get the distance between them, the midpoint of the segment and the slope of the line through them.
How to use the distance formula
- Enter the x and y of the first point.
- Enter the x and y of the second point.
- Read the distance, the midpoint and the slope of the line.
Examples
Two points
(1, 2) and (4, 6)
distance 5, midpoint (2.5, 4), slope 1.3333
Vertical line
(0, 0) and (0, 5)
distance 5, slope undefined (vertical)
Frequently asked questions
What is the distance formula?
The distance between two points is the square root of the change in x squared plus the change in y squared. It comes straight from the Pythagorean theorem.
How is the midpoint found?
The midpoint is the average of the two x coordinates and the average of the two y coordinates, giving the exact center of the segment between the points.
Why is the slope sometimes undefined?
Slope is the change in y divided by the change in x. When both points share the same x, the change in x is zero and the line is vertical, so the slope is undefined.
Does the order of the points matter?
No. The distance, midpoint and slope are the same whichever point you call first, because squaring and averaging remove any difference in order.
Can I use negative or decimal coordinates?
Yes. Any finite numbers work, including negatives and decimals. Only infinite or non-numeric values are rejected.
Related tools
Distance Between Two Points Calculator
Find the distance between two points with the distance formula. Get the length, midpoint and slope of the segment, computed live with full precision.
Slope Calculator
Find the slope, y-intercept, line equation, distance, midpoint and angle from two points. Enter two coordinates and read every value instantly.
Pythagorean Theorem Calculator
Find the missing side of a right triangle with a squared plus b squared equals c squared. Get the legs, hypotenuse, area and perimeter instantly.
Vector Calculator
Add, subtract, scale, and find the dot and cross product of 2D and 3D vectors. Get magnitude, unit vector, angle, distance, and projection instantly.
Annulus Area Calculator
Calculate the area of an annulus, the ring between two concentric circles, from its outer and inner radius. Returns both circumferences and width too. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.