All tools › Math Calculators › Algebra
Find the midpoint of two points, a missing endpoint, or the point that divides a segment in a given ratio.
Find the midpoint of a line segment, a missing endpoint, or a point in a given ratio
The midpoint is the point exactly halfway between two points. Its coordinates are the averages of the two x values and of the two y values. This midpoint calculator works that out for points on a plane or in space and shows the arithmetic for each coordinate.
Two further modes cover the questions that usually follow: finding the other endpoint when you know one endpoint and the midpoint, and finding the point that divides a segment in a ratio m : n.
How to use the midpoint calculator
- In What to find, choose the midpoint, the other endpoint, or the point dividing the segment in a ratio.
- Set Dimensions to plane (x, y) or space (x, y, z).
- Enter point A in x1 and y1 (and z1 in 3D).
- Enter point B in x2 and y2 (and z2). In endpoint mode these boxes hold the midpoint instead.
- In ratio mode, enter m, the part next to A, and n, the part next to B.
The formulas
Midpoint M = ((x1 + x2) / 2, (y1 + y2) / 2)
Other endpoint B = (2 x xm – x1, 2 x ym – y1)
Point in the ratio m : n: P = ((n x x1 + m x x2) / (m + n), (n x y1 + m x y2) / (m + n))
(x1, y1) is point A, (x2, y2) is point B and (xm, ym) is the midpoint. In 3D the z coordinate follows the same pattern. The third line is the section formula: P lies between A and B so that the distance from A to P and the distance from P to B are in the ratio m : n. With m = n it becomes the midpoint formula.
The page also reports the length of the segment, from the distance formula, and in 2D the slope of the segment. Midpoint mode adds the slope of the perpendicular bisector, the line through the midpoint at a right angle to the segment.
Worked example: A (-3, 4) and B (9, -1)
Choose the midpoint mode, keep the plane setting and enter x1 = -3, y1 = 4, x2 = 9, y2 = -1. The result is the midpoint (3, 1.5).
| Row | Result |
|---|---|
| x: (x1 + x2) / 2 | (-3 + 9) / 2 = 3 |
| y: (y1 + y2) / 2 | (4 + (-1)) / 2 = 1.5 |
| Distance between A and B | 13 |
| Distance from each point to the midpoint | 6.5 |
| Slope of the segment | -0.4166666667 |
| Slope of the perpendicular bisector | 2.4 |
Working backward. Switch to the other-endpoint mode, keep A at (-3, 4) and type the midpoint (3, 1.5) into the second pair of boxes. The page returns B = (9, -1), from 2 x 3 – (-3) = 9 and 2 x 1.5 – 4 = -1, and a whole length of 13.
A ratio. Back with B = (9, -1), the ratio mode with m = 1 and n = 2 gives the point (1, 2.333333333). It is 4.333333333 from A and 8.666666667 from B, which is 0.3333333333 of the way (33.3333%) along the segment.
Reading the result
- In ratio mode, m belongs to the piece touching A. A ratio of 1 : 3 is a quarter of the way from A; 3 : 1 is three quarters of the way.
- A slope shown as undefined means the segment is vertical, or the two points are the same.
- In 3D, the point (1, 2, 3) and the point (5, -4, 9) have the midpoint (3, -1, 6); slope is not reported because a line in space has no single slope.
Limits and assumptions
- Flat, straight-line geometry only. For two places on a map given as latitude and longitude, averaging the coordinates does not give the true halfway point on the globe.
- Ratio mode covers points between A and B. m and n cannot be negative, so points beyond the ends (external division) are not covered.
- Results are rounded to 10 significant digits.
Frequently asked questions
Is the midpoint the same as the average of the two points?
Yes. Each coordinate of the midpoint is the mean of the matching coordinates of the two endpoints.
Does it matter which point I call A and which B?
Not for the midpoint, the distance or the slope. It does matter in ratio mode, because m is measured from A, and in endpoint mode, where A is the known endpoint.
How do I find the midpoint of a segment on a number line?
Add the two numbers and divide by 2. On this page you can enter the two numbers as x1 and x2 and leave both y values at 0.
What is a perpendicular bisector?
It is the line that passes through the midpoint of a segment at a right angle to it. Every point on it is the same distance from both endpoints.
Related calculators
- Distance Calculator – length between two points, including latitude and longitude.
- Slope Calculator – slope and the equation of the line through two points.
- Average Calculator – the mean of a longer list of numbers.
- Ratio Calculator – simplify a ratio before using it here.

