Skip to content

Distance between two points calculator

Calculate the distance between two points (x, y) with the distance formula, plus the midpoint.

Distance
5
Δx / Δy3 / 4
Midpoint(2.5, 4)

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 →

Updated on June 30, 2026 · by Rafael Rossi · Methodology & sources