Algebra & Equations

Midpoint Calculator

Enter two points to find the midpoint of the line segment between them with M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right), shown in exact steps.

Try
Find

Two coordinates such as (2, −3), three for 3D, or one number for a number line. Fractions such as 3/4 work.

Same number of coordinates as A.

Result

Midpoint M: (2, 2)

Midpoint M

M=(2,2)M = \left(2, 2\right)

Length of AB
241≈12.806248472\sqrt{41} \approx 12.80624847
Distance from M to each endpointHalf the length of AB
41≈6.403124237\sqrt{41} \approx 6.403124237
Slope of AB
−54-\frac{5}{4}
Perpendicular bisectorEvery point on this line is the same distance from A and B.
y=45x+25y = \frac{4}{5}x + \frac{2}{5}

The point (2, 2) lies exactly halfway between (−2, 7) and (6, −3), about 6.403 units from each.

Segment AB and its midpoint (2, 2)
−20246−2−10123456xySegment ABGiven pointsMidpoint
Step-by-step working (5 steps)
  1. Write the midpoint formula

    Average each coordinate of the two endpoints.

    M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right)
  2. Substitute the coordinates

    M=(−2+62,7+(−3)2)M = \left(\frac{-2 + 6}{2}, \frac{7 + \left(-3\right)}{2}\right)
  3. Add, then divide by 2

    M=(42,42)=(2,2)M = \left(\frac{4}{2}, \frac{4}{2}\right) = \left(2, 2\right)
  4. Find the distance between the endpoints

    This is the distance formula, the Pythagorean theorem applied to the coordinate differences.

    d=(6−(−2))2+(−3−7)2=164=241≈12.80624847d = \sqrt{\left(6 - \left(-2\right)\right)^2 + \left(-3 - 7\right)^2} = \sqrt{164} = 2\sqrt{41} \approx 12.80624847
  5. Find the perpendicular bisector

    Its slope is the negative reciprocal of the slope of AB, and it passes through the midpoint.

    m⊥=−1−54=45,y=45x+25m_\perp = -\frac{1}{-\frac{5}{4}} = \frac{4}{5}, \quad y = \frac{4}{5}x + \frac{2}{5}

It also works for two numbers, 3D points and a missing endpoint.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Choose what to find: the midpoint, a missing endpoint when you know one end and the midpoint, a point at a ratio along the segment, or the centroid of several points.
  2. Type each point as its coordinates, such as (2, -3) for (x1,y1)(x_1, y_1). Parentheses are optional, and commas or spaces both separate the coordinates.
  3. Add a third coordinate, such as (1, 0, 4), to work in 3D, or type a single number in each box, such as 4 and 18, for the halfway point on a number line. Both points must have the same number of coordinates.
  4. Use negatives, decimals and fractions freely: -1/2, 0.75 and 1 1/2 are kept exact, so the answer is exact too.
  5. Read the answer at the top, then open the steps to see the formula with your numbers substituted. For 2D points the graph shows the segment and the result.

Formulas

Midpoint formula

M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2},\; \frac{y_1 + y_2}{2}\right)

Plain-text formula: M = ((x_1 + x_2)/2, (y_1 + y_2)/2)

(x1,y1)(x_1, y_1)
endpoint A
(x2,y2)(x_2, y_2)
endpoint B
MM
the point halfway between A and B

Each coordinate of the midpoint is the average of the matching coordinates of the endpoints. In 3D, add a third coordinate z1+z22\frac{z_1 + z_2}{2} in the same way.

Missing endpoint

x2=2xm−x1,y2=2ym−y1x_2 = 2x_m - x_1, \quad y_2 = 2y_m - y_1

Plain-text formula: x_2 = 2x_m − x_1, y_2 = 2y_m − y_1

Rearranging the midpoint formula gives the other endpoint when you know one endpoint and the midpoint (xm,ym)(x_m, y_m).

Section formula (point at a ratio)

P=(nx1+mx2m+n,ny1+my2m+n)P = \left(\frac{n x_1 + m x_2}{m + n},\; \frac{n y_1 + m y_2}{m + n}\right)

Plain-text formula: P = ((nx_1 + mx_2)/(m + n), (ny_1 + my_2)/(m + n))

P lies on AB with AP:PB=m:nAP : PB = m : n. With m=nm = n this is the midpoint formula. P is mm+n\frac{m}{m + n} of the way from A to B.

Distance formula

d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

Plain-text formula: d = √((x_2 − x_1)^2 + (y_2 − y_1)^2)

The length of AB, from the Pythagorean theorem (the Pythagorean theorem calculator shows that triangle). The midpoint formula averages the coordinates while this formula uses their differences, and the two fit together: the midpoint is d2\frac{d}{2} from each endpoint, a quick check on any answer.

Reading the result

The midpoint is the one point on line segment AB that is the same distance from both ends. Its coordinates are averages, so they can be fractions even when the endpoints are whole numbers: the midpoint of (1, 2) and (4, 7) is (52,92)=(2.5,4.5)\left(\frac{5}{2}, \frac{9}{2}\right) = (2.5, 4.5).

The perpendicular bisector is the line through the midpoint at a right angle to AB. Every point on it is the same distance from A and B, which is why it is used to find the center of a circle through three points. To see it, plot the segment and the bisector equation in the graphing calculator.

A common mistake is to subtract the coordinates instead of adding them. Subtracting gives the change (x2−x1,y2−y1)(x_2 - x_1, y_2 - y_1), which belongs in the slope and distance formulas, not the midpoint formula. Another is to drop a negative sign: with x1=−4x_1 = -4 and x2=8x_2 = 8, the sum is −4+8=4-4 + 8 = 4, not 12.

Which midpoint do you need?

This page finds the midpoint of two points on a coordinate plane or in 3D space. Other tools that share the name answer different questions, and some of them use the same averaging idea.

On a number line, the midpoint of two numbers aa and bb is their average a+b2\frac{a + b}{2}. The midpoint of 4 and 18 is 11. That is the 1D case of the formula above, and the calculator does it when you type one number in each box. The same works for a measurement: the center of a board marked from 12 cm to 87 cm is at 49.5 cm.

In a negotiation, the midpoint between an offer and a demand is also their average: halfway between 40,000 and 100,000 is 70,000. Type the two amounts as single numbers to get it with steps.

On a map, the halfway point between two places is not the plain average of their latitudes and longitudes. The Earth is curved, so a geographic midpoint is measured along a great circle with spherical trigonometry, and averaging longitudes fails badly across the 180° meridian. This calculator works on flat coordinates only, so use a mapping tool for travel or meeting points.

Midpoint, section point and centroid

All three are weighted averages of points. The table compares them for A = (0, 0) and B = (9, 6), and for a triangle with vertices (0, 0), (4, 0) and (2, 6).

How the midpoint relates to the section point and the centroid
PointFormulaExample
Midpoint of ABA+B2\frac{A + B}{2}(4.5, 3)
Point one third of the way from A (ratio 1 : 2)2A+B3\frac{2A + B}{3}(3, 2)
Centroid of a triangle ABCA+B+C3\frac{A + B + C}{3}(2, 2)

Worked example

Find the midpoint of (−4, 3) and (8, −2)

Find the midpoint of the segment from A(−4, 3) to B(8, −2), and check it with the distance formula.

  1. Label the coordinates: x1=−4x_1 = -4, y1=3y_1 = 3, x2=8x_2 = 8, y2=−2y_2 = -2.
  2. Average the x-coordinates: −4+82=42=2\frac{-4 + 8}{2} = \frac{4}{2} = 2.
  3. Average the y-coordinates: 3+(−2)2=12\frac{3 + (-2)}{2} = \frac{1}{2}.
  4. So M=(2,12)M = \left(2, \frac{1}{2}\right), or (2, 0.5) as decimals.
  5. Check: AB=122+(−5)2=169=13AB = \sqrt{12^2 + (-5)^2} = \sqrt{169} = 13, and AM=62+(−2.5)2=42.25=6.5AM = \sqrt{6^2 + (-2.5)^2} = \sqrt{42.25} = 6.5, exactly half of AB.

Answer: The midpoint is M=(2,12)M = \left(2, \frac{1}{2}\right). It is 6.5 units from each endpoint of a segment 13 units long.

Frequently asked questions

How do you calculate the midpoint?

Add the two x-coordinates and divide by 2, then do the same with the y-coordinates. For (2, 5) and (8, 1), the midpoint is (2+82,5+12)=(5,3)\left(\frac{2 + 8}{2}, \frac{5 + 1}{2}\right) = (5, 3).

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

Double the midpoint and subtract the endpoint you know: x2=2xm−x1x_2 = 2x_m - x_1 and y2=2ym−y1y_2 = 2y_m - y_1. With A = (3, −1) and M = (5, 4), the other endpoint is (7, 9). Choose Missing endpoint above to do this with steps.

Can the midpoint have fractions or negative coordinates?

Yes. Whenever a sum of coordinates is odd, the midpoint has a half, such as 52\frac{5}{2}. Negative coordinates work the same way as positive ones; just keep the signs when you add.

How do you find the midpoint in 3D?

Average all three coordinates: (x1+x22,y1+y22,z1+z22)\left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}, \frac{z_1 + z_2}{2}\right). The midpoint of (1, −2, 4) and (7, 6, −2) is (4, 2, 1). Type three coordinates per point above to use 3D.

What if both points are the same?

Then the midpoint is that same point and the distance between them is 0. There is no single perpendicular bisector, because a segment of length 0 has no direction.

What is the difference between the midpoint and the centroid?

The midpoint is the average of two points. The centroid of a triangle is the average of its three vertices, and it is where the three medians meet (each median joins a vertex to the midpoint of the opposite side). Choose Several points above to find it.

How do I find the midpoint on a calculator?

Work out one coordinate at a time, keeping the brackets so the whole sum is halved. For (−4, 3) and (8, −2), type (-4 + 8) / 2 to get 2, then (3 + -2) / 2 to get 0.5, so the midpoint is (2, 0.5). On many handheld scientific calculators the negative sign is a separate key from subtract. The scientific calculator here accepts the same keystrokes.

Slope Calculator

Slope from two points, an equation or rise and run, as a fraction, angle and percent grade, with steps.

Algebra & Equations

Graphing Calculator

Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.

Tools

Vector Calculator

Dot product, angle between vectors, magnitude, unit vector and projections of 2D to 6D vectors.

Linear Algebra

Triangle Calculator

Solve any triangle from SSS, SAS, ASA, AAS or SSA, with law of sines and cosines steps and the ambiguous case.

Trigonometry

Fraction Calculator

Add, subtract, multiply, divide and simplify fractions and mixed numbers, with every step shown.

Arithmetic & Numbers

Sources and further reading

  1. Algebra and Trigonometry 2e, Section 2.1: The Rectangular Coordinate Systems and Graphs (opens in a new tab), OpenStax, Rice University
  2. Midpoint (opens in a new tab), Wolfram MathWorld

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?