Distance and Midpoint Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Algebra & Trig#30

Distance & Midpoint

\(d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}\) in simplified radical form, and the midpoint of the segment.

This distance and midpoint calculator takes two points in the plane and returns the distance between them, the midpoint of the segment joining them, and the slope of that segment. Distances are given exactly, with square roots simplified (\( \sqrt{8} \) becomes \( 2\sqrt2 \)), plus a decimal.

It works as a distance formula calculator and a midpoint calculator in one, and it shows the set-up so you can copy the working into your notes. It’s free and needs no sign-up.

How to use the distance and midpoint calculator

  1. Enter the first point as x₁ and y₁.
  2. Enter the second point as x₂ and y₂. Negative numbers, fractions such as 3/4 and decimals all work.
  3. Press Calculate.
  4. Read the set-up line, the distance \( d \), the midpoint \( M \) and the slope.

Formulas

The distance formula is the Pythagorean theorem applied to the horizontal and vertical gaps between the points:

$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

The midpoint formula averages the coordinates:

$$M = \left( \frac{x_1 + x_2}{2},\ \frac{y_1 + y_2}{2} \right)$$

Worked example: a 6-8-10 triangle

Find the distance and midpoint for \( (1, 2) \) and \( (7, 10) \), as loaded above.

Gaps. \( \Delta x = 7 - 1 = 6 \) and \( \Delta y = 10 - 2 = 8 \).

Distance. \( d = \sqrt{6^2 + 8^2} = \sqrt{36 + 64} = \sqrt{100} = 10 \).

Midpoint. \( M = \left( \frac{1 + 7}{2}, \frac{2 + 10}{2} \right) = (4, 6) \).

Slope. \( \frac{8}{6} = \frac43 \).

Worked example: negative coordinates

For \( (-3, 5) \) and \( (2, -7) \): \( \Delta x = 2 - (-3) = 5 \) and \( \Delta y = -7 - 5 = -12 \). Squaring removes the sign, so

$$d = \sqrt{25 + 144} = \sqrt{169} = 13$$

The midpoint is \( \left( \frac{-3 + 2}{2}, \frac{5 + (-7)}{2} \right) = \left( -\frac12, -1 \right) \).

Worked example: a simplified root

From \( (0, 0) \) to \( (2, 2) \), \( d = \sqrt{4 + 4} = \sqrt8 = 2\sqrt2 \approx 2.828 \). That’s the diagonal of a square with side 2, the \( 45^\circ \)-\( 45^\circ \)-\( 90^\circ \) pattern covered in special right triangles.

Tips and common mistakes

  • Adding instead of subtracting. Distance uses differences, \( x_2 - x_1 \). The midpoint uses sums, \( x_1 + x_2 \).
  • Taking the root of each term. \( \sqrt{a^2 + b^2} \neq a + b \). For the first example, \( 6 + 8 = 14 \), not 10.
  • Forgetting to halve. The midpoint divides each sum by 2.
  • Finding an endpoint from a midpoint. If \( M = (4, 6) \) and one end is \( (1, 2) \), the other end is \( (2\cdot4 - 1,\ 2\cdot6 - 2) = (7, 10) \).

Distance in calculus

Arc length is the distance formula applied to tiny pieces of a curve: each piece has length \( \sqrt{(\Delta x)^2 + (\Delta y)^2} \), and adding them up as the pieces shrink gives \( \int_a^b \sqrt{1 + f'(x)^2}\,dx \). See the arc length formula guide and the arc length calculator.

Related guides

Further reading

FAQ

What is the distance formula?

\( d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \). It’s the Pythagorean theorem with the horizontal and vertical gaps as the legs.

What is the midpoint formula?

\( M = \left( \frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2} \right) \), the average of the x-coordinates and the average of the y-coordinates.

Does the order of the points matter?

No. Squaring removes the sign of each difference, and averaging gives the same midpoint either way.

How do I find distance in 3D?

Add the third gap under the root: \( d = \sqrt{(\Delta x)^2 + (\Delta y)^2 + (\Delta z)^2} \). This calculator handles 2D points.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators