Distance Formula and Midpoint Calculator

Distance and midpoint between two points

d = √((x₂ − x₁)² + (y₂ − y₁)²)

First point x₁ · First point y₁ · Second point x₂ · Second point y₂

P₁ = (0, 0)P₂ = (6, 8)run = 6rise = 8

Join the two labelled points with a straight segment.

d = √((x₂ − x₁)² + (y₂ − y₁)²)

Coordinates are translated and scaled together for display; the midpoint is halfway along the segment, including when the points coincide.

Worked example you can change

Distance = √((x₂ − x₁)² + (y₂ − y₁)²)

Editable worked example
P₁ = (, ), P₂ = (, )
  1. Distance = √((6 − (0))² + (8 − (0))²)
  2. Distance ≈ 10
  3. Midpoint x = (0 + (6)) ÷ 2 ≈ 3
  4. Midpoint y = (0 + (8)) ÷ 2 ≈ 4

Calculator

Enter complete decimal numbers; separate list values with commas or spaces. Decimal answers are shown to 15 significant digits; exact integer results retain all digits.

Calculator inputs
Distance
10
Midpoint x
3
Midpoint y
4

Formula variants

Related formulas and when to use them
Shape or methodFormulaMeaning
Distanced = √((x₂ − x₁)² + (y₂ − y₁)²)Distance is nonnegative, even if either coordinate difference is negative.
MidpointM = ((x₁ + x₂)/2, (y₁ + y₂)/2)Average x and y separately to find the point halfway along the segment.
Coincident pointsd = 0; midpoint = the same pointThe formulas remain defined when the two points coincide.

Questions

What is the distance formula?

Subtract the x coordinates and y coordinates separately, square both differences, add them, and take the square root.

What is the midpoint formula?

Average the two x coordinates for midpoint x, and average the two y coordinates for midpoint y.

Can I use negative coordinates?

Yes. Signed coordinates are supported; the distance stays nonnegative.

Is this geographic distance?

No. It uses a flat two-dimensional coordinate plane rather than latitude, longitude or a route on Earth.

Sources and method

Find the straight-line distance and midpoint between two planar points using the Pythagorean theorem and coordinate averages.

We calculate with 40 significant digits and round only the displayed result. Diagrams are labelled explanations and are not measurement drawings.

More Math formulas

Browse Math calculators

Updated