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.
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).
The segment AB
Show steps
- Label the points: A(x₁, y₁) = (−1, 2) and B(x₂, y₂) = (5, 6).
- Write the change in each coordinate (second point minus first): Δx = x₂ − x₁ = 5 − (−1) = 6, Δy = y₂ − y₁ = 6 − 2 = 4.
- Use the distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²): d = √(6² + 4²) = √(36 + 16) = √52.
- Simplify: √52 = √(4 × 13) = √4 × √13 = 2√13. So d = 2√13 ≈ 7.21.
- Midpoint: average each pair of coordinates. M = ((−1 + 5)/2, (2 + 6)/2) = (2, 4).
- Slope of AB: m = Δy / Δx = 4 / 6 = 2/3. The line through A and B is y = (2/3)x + 8/3.
- The perpendicular bisector passes through M with the negative reciprocal slope −1 / (2/3) = −3/2: y = −(3/2)x + 7.
- 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.
How to use the distance and midpoint calculator
- Choose 2D points, 3D points, or Find endpoint (when you know one endpoint and the midpoint).
- Type the coordinates. Whole numbers, decimals and fractions such as 3/4 all work, and the answer updates as you type.
- 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.
- 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.
Δx = 6 and Δy = 8, so d = √(36 + 64) = √100 = 10. Adding 6 + 8 = 14 skips the squaring and the square root.
Average each coordinate: (−2 + 6)/2 = 2 and (5 + (−1))/2 = 2. Subtracting instead of adding gives (−4, 3).
72 = 36 × 2 and 36 is the largest perfect square factor, so √72 = 6√2. 2√18 is correct in value but not fully simplified.
Each coordinate of B is 2M − A: 2 × 3 − 1 = 5 and 2 × (−2) − 4 = −8. Averaging A and M gives (2, 1), which is wrong.
The x-coordinates are equal, so the segment is vertical and the distance is |9 − (−2)| = 11.
(1/2 + 5/2)/2 = 3/2 and (3 + (−1))/2 = 1, so the midpoint is (3/2, 1).
The full distance is √(6² + 8²) = 10, and the midpoint is halfway, so the answer is 5. Directly: the midpoint is (5, 7) and √(3² + 4²) = 5.
The distance formula is the Pythagorean theorem: square the changes, add, then take the square root. The averages form the midpoint, not the distance.
Quiz complete
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
- Slope calculator
- Pythagorean theorem calculator
- Equation of a line calculator
- Circle equation calculator
- Radical simplifier
More geometry & trig calculators
Related to This Article
More math articles
- Clinton, NAFTA and the Third Way: Policy and Globalization
- 4th Grade MAAP Math Worksheets: FREE & Printable
- How to Help Your Child Love Math: 10 Tips That Actually Work
- The Best HSPT Math Worksheets: FREE & Printable
- 3rd Grade English Worksheets for North Carolina (EOG): 59 Free Printable PDFs
- Measurement in Chemistry: Units, Density, and Instrument Precision
- 8th Grade MCAS Math Worksheets: FREE & Printable
- Peers
- A Comprehensive Guide to Grasping the Essence of Absolute Value Functions
- Writing a Focused Thesis






What people say about "Distance and Midpoint Calculator With Graph: 2D, 3D, Steps"?
No one replied yet.