Free tool

Midpoint and distance calculator, with the steps.

Type two points and get the midpoint, the distance between them as an exact root like 4√5 and as a decimal, the slope and the perpendicular bisector, with the formula, your numbers put in and a graph that draws the right triangle. It also does three dimensions, finds a missing endpoint from the midpoint, and finds the point a third of the way along.

What to find

Point 1

Known endpoint

Point 2

Midpoint

Ratio, from point 1 to point 2

Use whole numbers, decimals like 2.5 or fractions like 1/2. Negative numbers are fine.

Type one end of the segment and the midpoint to get the other end.

A ratio of 1:2 puts the point one third of the way from point 1 to point 2.

Worked out in your browser. Nothing is sent anywhere.

The maths

An average, and Pythagoras.

01 / Midpoint

Average the coordinates

M = ((x₁ + x₂)/2, (y₁ + y₂)/2). Add the two x values and halve, then do the same for y.

02 / Distance

Pythagoras on the gaps

d = √((x₂ − x₁)² + (y₂ − y₁)²). The two gaps are the legs of a right triangle and d is its longest side.

03 / Exact

Roots stay as roots

√80 is shown as 4√5, with the decimal beside it, and fractions stay fractions.

Guide

The midpoint formula and distance formula, with worked examples.

The midpoint formula finds the point exactly halfway between two points: add the two x values and halve them, then do the same with the y values. The distance formula gives the length of the segment between them, using Pythagoras. This calculator does both for any two points, gives the distance as an exact root and as a decimal, and shows each step with your numbers put in. It also finds the slope, the perpendicular bisector, the midpoint and distance in three dimensions, a missing endpoint, and the point that splits a segment in a ratio.

How to use the calculator

  1. Under Two points, type the x and y of Point 1 and Point 2. The answer updates as you type.
  2. Read the cards: the midpoint, the distance, the slope, half the distance and the perpendicular bisector. Under them is The working, and below that the graph, with the right triangle drawn dotted.
  3. Choose 3D points to add a z value for each point.
  4. Choose Find an endpoint when you know one end and the midpoint. Type them in to get the other end.
  5. Choose Split in a ratio, type the two parts, or click a button like 1:2 a third, to find a point along the segment.
  6. Swap the points flips the two points, Copy result copies the answer as a line, and Copy link copies a link with your numbers in it.

The formulas

WhatFormula
Midpoint in 2DM = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Midpoint in 3DM = ((x₁ + x₂)/2, (y₁ + y₂)/2, (z₁ + z₂)/2)
Distance in 2Dd = √((x₂ − x₁)² + (y₂ − y₁)²)
Distance in 3Dd = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Missing endpointx₂ = 2 × Mx − x₁, y₂ = 2 × My − y₁
Point at ratio m : n((n × x₁ + m × x₂)/(m + n), (n × y₁ + m × y₂)/(m + n))

Worked examples

  • Two points, (2, 3) and (6, 11). The midpoint is ((2 + 6)/2, (3 + 11)/2) = (4, 7). The gaps are 6 − 2 = 4 and 11 − 3 = 8, so d = √(16 + 64) = √80. Since 80 = 16 × 5, that is 4√5, about 8.9443. The slope is 8/4 = 2.
  • Negative numbers, (−3, 4) and (5, −2). The midpoint is ((−3 + 5)/2, (4 + (−2))/2) = (1, 1). The gaps are 5 − (−3) = 8 and −2 − 4 = −6, so d = √(64 + 36) = √100 = 10. Take care: taking away a negative number adds.
  • Fractions, (1/2, 1/3) and (3/2, 5/3). The midpoint is (1, 1). The gaps are 1 and 4/3, so d² = 1 + 16/9 = 25/9 and d = 5/3.
  • Three dimensions, (1, 2, 3) and (4, 6, 15). The midpoint is (5/2, 4, 9). The gaps are 3, 4 and 12, so d = √(9 + 16 + 144) = √169 = 13.
  • A missing endpoint. One end is (2, 3) and the midpoint is (4, 7). The other end is x = 2 × 4 − 2 = 6 and y = 2 × 7 − 3 = 11, which is (6, 11). Check: the midpoint of (2, 3) and (6, 11) is (4, 7).
  • A ratio. To find the point one third of the way from (0, 0) to (9, 6), use m : n = 1 : 2. The x value is (2 × 0 + 1 × 9)/3 = 3 and the y value is (2 × 0 + 1 × 6)/3 = 2, so the point is (3, 2). The whole segment is √117 = 3√13, and the point is √13, about 3.6056, from the start.

The perpendicular bisector

The perpendicular bisector is the line that crosses the segment at its midpoint at a right angle. Its slope is the negative reciprocal of the segment's slope. For (2, 3) and (6, 11) the slope is 2, so the bisector has slope −1/2. It goes through (4, 7), so b = 7 − (−1/2)(4) = 9 and the line is y = −x/2 + 9. If the segment is flat, the bisector is a vertical line x = the midpoint's x. If the segment is vertical, the bisector is a flat line.

Common problems

  • Which point is first. It does not matter. Swapping the points gives the same midpoint and the same distance, because the gaps are squared.
  • Forgetting to halve. The midpoint is the sum divided by 2, not the sum.
  • Leaving the root. √80 is a fine exact answer, and 4√5 is the tidy form. The decimal is rounded.
  • Same point twice. The midpoint is that point and the distance is 0, so there is no bisector.

For the equation of the whole line, with both intercepts, use the slope calculator. For a right triangle with a known side, try the triangle calculator, and to work with fractions use the fraction calculator.

Questions

Good to know.

What is the midpoint formula?

M = ((x₁ + x₂)/2, (y₁ + y₂)/2). It averages the x values and the y values of the two endpoints.

What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²). It is the Pythagorean theorem applied to the horizontal and vertical gaps.

Does the order of the points matter?

No. The midpoint and the distance are the same either way round.

How do I find the midpoint of a line segment on a graph?

Read the coordinates of both ends, then average the x values and average the y values. The graph here marks the midpoint in green.

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

Double the midpoint and subtract the known end, one coordinate at a time. Use Find an endpoint to see the steps.

Can I use fractions and decimals?

Yes. Type 1/2 or 0.5. The working is exact, so 1/3 stays 1/3 instead of 0.3333.

How do I find a third of the way along a segment?

Use Split in a ratio with 1 and 2. The point is one third of the way from point 1.

Why is the distance sometimes shown with a root?

Most distances are not whole numbers. A root like 4√5 is exact, and the calculator shows its decimal next to it.

Is anything sent anywhere?

No. Everything is worked out in your browser.