Uni-Sine
MathematicsGeometry

Midpoint calculator with the midpoint formula and a plot

The midpoint of two points is halfway between them: average the x coordinates and average the y coordinates. So the midpoint of (1, 2) and (7, 5) is ((1 + 7)/2, (2 + 5)/2) = (4, 3.5). This midpoint calculator does that for any two points, gives the answer exactly as fractions, and also finds the distance between the points, the gradient (slope) and the equation of the line through them, all drawn on a coordinate plot.

It opens on (1, 2) and (7, 5). Type your own points, or open the full midpoint and distance calculator over this page.

Try it

Midpoint and Distance Calculator

Find the midpoint, distance and gradient between two points

Go to its page

How to use the midpoint calculator

  1. Type the first point in A: x and A: y, and the second in B: x and B: y. Negative numbers and decimals are fine.
  2. Or drag A and B on the coordinate plot. They snap to the grid, and every answer updates as you move.
  3. Read the Midpoint at the top, with the Distance, the Gradient and the Line through both points beside it.
  4. The working below shows each formula with your numbers in it. The plot marks the midpoint and draws the right-angled triangle used for the distance.
  5. To practise, press Random problem in the Practice section.

Answers are exact: a midpoint like (4, 3.5) shows as (4, 7/2), and a distance like √45 shows as 3√5 with the decimal 6.708204 beside it. Coordinates can go up to a million either way.

The midpoint formula

M = \left(\frac{x_1 + x_2}{2},\ \frac{y_1 + y_2}{2}\right)The midpoint of (x₁, y₁) and (x₂, y₂)

Each coordinate of the midpoint is the mean of the two matching coordinates. It doesn't matter which point you call the first: adding is the same either way round. The midpoint splits the segment in the ratio 1 : 1, the simplest case of dividing a segment in a given ratio, which the Common Core standards for high school geometry cover.

Worked examples you can check in the calculator

Example 1: the midpoint of a line segment

Find the midpoint of A(1, 2) and B(7, 5), the calculator's opening points.

M = \left(\frac{1 + 7}{2},\ \frac{2 + 5}{2}\right) = \left(4,\ \frac{7}{2}\right)

The midpoint is (4, 3.5). The calculator also gives the distance, √(6² + 3²) = √45 = 3√5 ≈ 6.708, the gradient, 3/6 = 1/2, and the line y = ½x + 3/2.

01234567812345ABM(1, 2)(4, 3.5)(7, 5)
The tick marks show AM and MB are the same length

Example 2: negative coordinates

Find the midpoint of (−3, 4) and (5, −2). Take care with the signs as you add:

M = \left(\frac{-3 + 5}{2},\ \frac{4 + (-2)}{2}\right) = \left(\frac{2}{2},\ \frac{2}{2}\right) = (1,\ 1)

The midpoint is (1, 1). The points are 8 apart across and 6 apart up, so the distance between them is exactly 10.

Example 3: decimals

Find the midpoint of (2.5, −1) and (−4, 6). The x coordinate is (2.5 + (−4)) ÷ 2 = −1.5 ÷ 2 = −0.75, and the y coordinate is (−1 + 6) ÷ 2 = 2.5. The midpoint is (−0.75, 2.5), which the calculator writes as (−3/4, 5/2).

Example 4: find the endpoint given the midpoint

M(3, −2) is the midpoint of A(−1, 4) and B. Find B. The midpoint is halfway, so B is as far past M as A is before it. Double the midpoint and take away A:

B = (2 \times 3 - (-1),\ 2 \times (-2) - 4) = (7,\ -8)

So B = (7, −8). The calculator doesn't work backwards, but you can check: type A(−1, 4) and B(7, −8), and the midpoint comes out as (3, −2).

Example 5: the perpendicular bisector

The perpendicular bisector of AB passes through its midpoint at right angles to it. For A(2, 1) and B(6, 9), the calculator gives the midpoint (4, 5) and the gradient 8/4 = 2. A perpendicular line has gradient −1/2, the negative reciprocal. Through (4, 5):

y - 5 = -\frac{1}{2}(x - 4) \quad \Rightarrow \quad y = -\frac{1}{2}x + 7

Every point on this line is the same distance from A as from B. It is a common exam question because it uses the midpoint and the gradient together.

Try one

practice
Pick an answer, then check it.
What is the midpoint of (−2, 7) and (6, −3)?

Distance, gradient and the line

The calculator gives three more answers for the same two points, since questions often ask for them together:

AnswerFormulaFor (1, 2) and (7, 5)
Distanced = √((x₂ − x₁)² + (y₂ − y₁)²)√45 = 3√5 ≈ 6.708
Gradient (slope)m = (y₂ − y₁) ÷ (x₂ − x₁)3 ÷ 6 = 1/2
Line through bothy = mx + c, with c from either pointy = ½x + 3/2

The distance formula is the Pythagorean theorem: the run and the rise are the two shorter sides of a right triangle, and the distance is the hypotenuse. The Pythagorean theorem calculator guide explains it. When the two x values are equal the line is vertical, and the calculator says the gradient is undefined.

Common mistakes

  • Subtracting instead of adding. The midpoint adds the coordinates. Subtracting is for the distance and the gradient.
  • Forgetting to halve. (x₁ + x₂) on its own is twice the midpoint's x.
  • Mixing x and y. Average the x values with each other and the y values with each other.
  • Sign slips with negatives. 4 + (−2) = 2. Write negatives in brackets as you substitute.
  • Halving the endpoint instead of doubling the midpoint when you are finding a missing endpoint. B = 2M − A.

Common questions

How do you find the midpoint of two points?
Add the two x coordinates and halve, then add the two y coordinates and halve. For (1, 2) and (7, 5) that is (4, 3.5).
How do you find an endpoint from the midpoint?
Double the midpoint and subtract the endpoint you know: B = (2x_M − x_A, 2y_M − y_A). If M is (3, −2) and A is (−1, 4), B is (7, −8).
Is the midpoint formula the same as the average?
Yes. Each coordinate of the midpoint is the mean of the two coordinates.
How do you find the midpoint in 3D?
The same way, with a third coordinate: average the x values, the y values and the z values. The midpoint of (1, 0, 4) and (3, 6, 2) is (2, 3, 3). This calculator works in 2D.
Can the midpoint have fractions or decimals?
Yes, whenever the two coordinates add to an odd number. The calculator keeps these exact as fractions, such as 7/2.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Midpoint and Distance Calculator

    Find the midpoint, distance and gradient between two points

    Open the tool
  • Test it

    Geometry, Algebra 2 & SAT Math

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · GeometryLine segment: definition, notation, length and midpointWhat a line segment is, how it differs from a line and a ray, how to name it, and how to find its length and midpoint on a number line or a graph.