Distance & Midpoint Calculator (Free, with Graph)

Geometry & trigFreeNo sign-up

A distance and midpoint calculator uses two short formulas. For (2, 1) and (8, 9), the distance is d = √((8 − 2)² + (9 − 1)²) = √(36 + 64) = √100 = 10, and the midpoint is ((2 + 8)/2, (1 + 9)/2) = (5, 5). When the answer is not a whole number, give it as a simplified radical such as 2√13, then round it: about 7.21.

Distance and midpoint calculator: choose a mode
Point A
Point B
Try:
Coordinates can be whole numbers, decimals or fractions such as 3/4.
Distance and midpoint
d = 2√13≈ 7.21

Midpoint M = (2, 4)

The distance from A(−1, 2) to B(5, 6) is 2√13 ≈ 7.21, and the midpoint of AB is (2, 4).

Distance d2√13 ≈ 7.21
Midpoint M(2, 4)
Δx6
Δy4
d² (squared distance)52
Half distance (A to M)√13 ≈ 3.61

The segment AB

Slope of AB2/3
Line through A and By = (2/3)x + 8/3
Perpendicular bisectory = −(3/2)x + 7
−444Δx = 6Δy = 4d = 2√13A(−1, 2)B(5, 6)M(2, 4)Green: segment AB. Yellow dot: the midpoint M. Gold dashed: the legs Δx and Δy of the right triangle. Blue dashed: the perpendicular bisector.
Show steps
  1. Label the points: A(x₁, y₁) = (−1, 2) and B(x₂, y₂) = (5, 6).
  2. Write the change in each coordinate (second point minus first): Δx = x₂ − x₁ = 5 − (−1) = 6, Δy = y₂ − y₁ = 6 − 2 = 4.
  3. Use the distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²): d = √(6² + 4²) = √(36 + 16) = √52.
  4. Simplify: √52 = √(4 × 13) = √4 × √13 = 2√13. So d = 2√13 ≈ 7.21.
  5. Midpoint: average each pair of coordinates. M = ((−1 + 5)/2, (2 + 6)/2) = (2, 4).
  6. Slope of AB: m = Δy / Δx = 4 / 6 = 2/3. The line through A and B is y = (2/3)x + 8/3.
  7. The perpendicular bisector passes through M with the negative reciprocal slope −1 / (2/3) = −3/2: y = −(3/2)x + 7.
  8. Check: the distance from A to M is √(3² + 2²) = √13 = √13 ≈ 3.61, exactly half of d. ✓

The distance formula is the Pythagorean theorem: Δx and Δy are the legs of a right triangle and d is its hypotenuse.

Distance & Midpoint Calculator (Free, with Graph)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the distance and midpoint calculator

  1. Choose 2D points, 3D points, or Find endpoint (when you know one endpoint and the midpoint).
  2. Type the coordinates. Whole numbers, decimals and fractions such as 3/4 all work, and the answer updates as you type.
  3. Read the distance as an exact simplified radical and as a decimal, the midpoint, Δx and Δy, the slope of the segment, the line through the points and the perpendicular bisector.
  4. Pick a unit and the number of decimal places if you need them, check the graph, and open Show steps to see the full working.

The distance formula and the midpoint formula

Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²). Here (x₁, y₁) and (x₂, y₂) are the two points. Δx = x₂ − x₁ is the horizontal change and Δy = y₂ − y₁ is the vertical change. These two changes are the legs of a right triangle, and the segment between the points is its hypotenuse, so the distance formula is simply the Pythagorean theorem, a² + b² = c², written with coordinates.

Midpoint: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). Each coordinate of the midpoint is the average of the matching coordinates of the endpoints. The midpoint is the same distance from both ends, so the distance from A to M is always exactly half of d.

In three dimensions you add a third term: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²) and M = ((x₁ + x₂)/2, (y₁ + y₂)/2, (z₁ + z₂)/2).

Quantity Formula For (−1, 2) and (5, 6)
Change in x Δx = x₂ − x₁ 5 − (−1) = 6
Change in y Δy = y₂ − y₁ 6 − 2 = 4
Distance √(Δx² + Δy²) √52 = 2√13 ≈ 7.21
Midpoint average of the coordinates (2, 4)
Slope of the segment Δy / Δx 4/6 = 2/3

Worked examples

Example 1: a whole-number distance

For (−1, 2) and (3, 5): Δx = 3 − (−1) = 4 and Δy = 5 − 2 = 3. Then d = √(4² + 3²) = √(16 + 9) = √25 = 5. The midpoint is ((−1 + 3)/2, (2 + 5)/2) = (1, 7/2). Notice the 3-4-5 right triangle hiding inside.

Example 2: a distance that is a radical

For (1, 2) and (4, 8): Δx = 3 and Δy = 6, so d = √(9 + 36) = √45. Since 45 = 9 × 5 and 9 is a perfect square, √45 = √9 × √5 = 3√5 ≈ 6.71. Teachers usually want the exact answer 3√5, so simplify the radical before you round.

Example 3: finding a missing endpoint

The midpoint of AB is M(1, 4) and A is (−4, 7). Each coordinate of B is twice the midpoint minus A: x = 2 × 1 − (−4) = 6 and y = 2 × 4 − 7 = 1, so B = (6, 1). Check: ((−4 + 6)/2, (7 + 1)/2) = (1, 4). The segment AB has length √(10² + (−6)²) = √136 = 2√34 ≈ 11.66.

Example 4: distance between two points in 3D

For (1, 2, 3) and (4, 6, 15): the changes are 3, 4 and 12, so d = √(9 + 16 + 144) = √169 = 13. The midpoint is (5/2, 4, 9). The base diagonal √(3² + 4²) = 5 and the height 12 form a 5-12-13 right triangle, which is why the formula works in space.

Simplifying the square root in the distance

To write √n in simplest radical form, find the largest perfect square that divides n, take its root outside, and leave the rest inside. Some values that come up often:

d² Exact distance Decimal
8 2√2 2.83
18 3√2 4.24
20 2√5 4.47
45 3√5 6.71
50 5√2 7.07
52 2√13 7.21
72 6√2 8.49
98 7√2 9.90

If d² is a perfect square (25, 100, 169), the distance is a whole number. If d² has no square factor other than 1 (such as 13 or 34), the radical is already simplified.

Common mistakes with distance and midpoint

  • Losing a negative sign. 3 − (−1) is 4, not 2. Put negative coordinates in parentheses before you subtract.
  • Subtracting in the midpoint formula. The midpoint adds the coordinates and halves them; only the distance formula subtracts.
  • Adding before squaring. √(Δx² + Δy²) is not Δx + Δy. For Δx = 3 and Δy = 4 the distance is 5, not 7.
  • Taking the root of each term. √(9 + 16) is √25 = 5, not √9 + √16 = 7.
  • Rounding too early. Keep the exact radical until the last step, then round once.
  • Averaging A and M to find an endpoint. That gives the point halfway to the midpoint. Double the midpoint and subtract the known endpoint instead.

Using the calculator for homework

Work the problem by hand first, then type the same points and compare. If your answer differs, open Show steps and find the first line where your working is different. Usually it is a sign or a square. Before you trust any distance, check that it is at least as long as the larger of |Δx| and |Δy| and no longer than |Δx| + |Δy|. The graph is a quick way to see whether the midpoint really sits in the middle of the segment.

Where distance and midpoint are used

In geometry they prove facts about shapes: equal side lengths show a triangle is isosceles, and diagonals that share a midpoint show a quadrilateral is a parallelogram. The radius of a circle is the distance from its center to a point on it, and the center of a circle is the midpoint of any diameter. On maps and grids, the straight-line distance between two locations is the distance formula, and the midpoint is a fair place to meet halfway.

Distance and Midpoint practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. What is the distance between (1, 1) and (7, 9)?

Found a mistake? Let us know!

2. What is the midpoint of (−2, 5) and (6, −1)?

Found a mistake? Let us know!

3. What is the distance between (−3, 4) and (2, −1) in simplest radical form?

Found a mistake? Let us know!

4. Simplify √72.

Found a mistake? Let us know!

5. M(3, −2) is the midpoint of AB and A = (1, 4). What is B?

Found a mistake? Let us know!

6. What is the distance between (0, 0, 0) and (2, 3, 6)?

Found a mistake? Let us know!

7. What is the distance between (4, −2) and (4, 9)?

Found a mistake? Let us know!

8. What is the midpoint of (1/2, 3) and (5/2, −1)?

Found a mistake? Let us know!

9. A segment runs from (2, 3) to (8, 11). How far is it from (2, 3) to the midpoint?

Found a mistake? Let us know!

10. Which expression gives the distance between (x₁, y₁) and (x₂, y₂)?

Found a mistake? Let us know!

Frequently asked questions

What is the formula for midpoint and distance?

The distance between (x₁, y₁) and (x₂, y₂) is d = √((x₂ − x₁)² + (y₂ − y₁)²), and the midpoint is ((x₁ + x₂)/2, (y₁ + y₂)/2). Distance subtracts and squares the changes; midpoint adds and halves the coordinates.

How do you find the distance between two points?

Subtract the x-coordinates and the y-coordinates, square both differences, add them, and take the square root. For (−1, 2) and (3, 5), the differences are 4 and 3, so d = √(16 + 9) = 5.

How do you find the midpoint between two points?

Average the x-coordinates and average the y-coordinates. The midpoint of (−4, 7) and (6, 1) is ((−4 + 6)/2, (7 + 1)/2) = (1, 4).

How do you find an endpoint when you know the midpoint?

Use B = 2M − A for each coordinate. With A(2, −3) and M(5, 1), B = (2 × 5 − 2, 2 × 1 − (−3)) = (8, 5).

Are there distance and midpoint practice problems?

Yes. The 10-question quiz above has worked explanations, and the Try buttons in the calculator load ready-made problems, including fractions, vertical segments, 3D points and missing endpoints.

How are distance and midpoint used in geometry?

They measure side lengths, find centers, and prove properties. For example, if both diagonals of a quadrilateral have the same midpoint, the diagonals bisect each other and the shape is a parallelogram.

Related calculators

More geometry & trig calculators

Browse all 206 calculators

Related to This Article

What people say about "Distance and Midpoint Calculator With Graph: 2D, 3D, Steps"?

No one replied yet.

Leave a Reply