Distance between two points calculator
Calculate the distance between two points (x, y) with the distance formula, plus the midpoint.
How the calculation works
The distance between two points in the plane is the Pythagorean theorem in disguise: the difference in X and Y are the legs, and the distance is the hypotenuse.
d = √[(x₂−x₁)² + (y₂−y₁)²]
The midpoint is the average of the coordinates:
M = ((x₁+x₂)/2, (y₁+y₂)/2)
Step-by-step example
From A(1, 2) to B(4, 6):
- Differences: Δx = 3, Δy = 4
- Distance: √(3² + 4²) = 5
- Midpoint: (2.5, 4)
Examples
- From (0,0) to (6,8): distance = 10; midpoint (3,4).
- Points sharing the Y coordinate: distance is just |x₂ − x₁|.
Frequently asked questions
Does it work in 3D?
This version is for the plane (2D). In 3D you add (z₂−z₁)² inside the root.
Why does the formula use Pythagoras?
Because the line between the points is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps.
Is the midpoint always between the two points?
Yes, it is exactly halfway along the segment joining A and B — equidistant from both.
Related calculators
More Math calculators
See all →Scientific calculator
Free online scientific calculator: sine, cosine, tangent, root, power, log, ln, π and parentheses.
Percentage
Calculate percentages every way: X% of Y, increase, discount and percentage change.
Rule of three
Solve a simple rule of three (direct or inverse): enter three values and find the fourth.
Compound rule of three
Solve problems where two quantities vary at once (machines, days, output...), directly or inversely.
Area of shapes
Calculate the area of a square, rectangle, triangle, circle and trapezoid in seconds.
Logarithm
Calculate the logarithm of a number in any base, plus natural log (ln), log10 and log2.
Trigonometry (sin, cos, tan)
Calculate the sine, cosine and tangent of an angle in degrees or radians.
Slope / grade
Calculate slope as a percentage, the angle and the ratio from rise and run.
Updated on June 30, 2026 · by Rafael Rossi · Methodology & sources