Midpoint Calculator
Find the midpoint of a line segment in 2D or 3D. Enter the coordinates of the two endpoints and get the midpoint plus the segment length instantly.
Find the Midpoint of a Segment
Midpoint Formula
Where:
- \(x_1, y_1, z_1\) — coordinates of the first endpoint
- \(x_2, y_2, z_2\) — coordinates of the second endpoint
- \(M\) — the midpoint of the segment
The midpoint is simply the average of each coordinate: add the two values and divide by 2. The first formula works for points in the plane (2D), the second for points in space (3D). The calculator also shows the segment length using the Euclidean distance formula:
\[ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \]
Midpoint – Calculation Example
Example: find the midpoint of the segment connecting \(A(2, 3, 1)\) and \(B(8, 7, 5)\) in three-dimensional space.
\[ M_x = \frac{2 + 8}{2} = \frac{10}{2} = 5 \]
\[ M_y = \frac{3 + 7}{2} = \frac{10}{2} = 5 \]
\[ M_z = \frac{1 + 5}{2} = \frac{6}{2} = 3 \]
\[ d = \sqrt{(8-2)^2 + (7-3)^2 + (5-1)^2} = \sqrt{36 + 16 + 16} = \sqrt{68} \approx 8.246 \]
Result: the midpoint is \(M = (5, 5, 3)\) and the segment length is approximately 8.246 units.
How to use the calculator
- Enter the X coordinate and Y coordinate of the first point under “Point 1 (x₁, y₁)”.
- Enter the X coordinate and Y coordinate of the second point under “Point 2 (x₂, y₂)”.
- If your points are in three-dimensional space, tick Work in 3D (use Z coordinates) and fill in the Z coordinate fields for both points. If you leave the box unticked, the Z fields are hidden and only the 2D midpoint is computed.
- Read the results: Midpoint X, Midpoint Y and, in 3D mode, Midpoint Z give the coordinates of the midpoint, and Segment Length gives the straight-line distance between the two points.
What is a midpoint?
The midpoint of a segment is the point that lies exactly halfway between the two endpoints — it cuts the segment into two pieces of equal length. In coordinate geometry, you find it by averaging the coordinates: each coordinate of the midpoint is the mean of the corresponding coordinates of the endpoints. Since averaging is just adding and dividing by two, the same idea works in two dimensions, three dimensions, or any number of dimensions.
The midpoint has a useful geometric property: it is equidistant from both endpoints, each half of the segment being exactly half the total length. It is also the center of the smallest circle (or sphere, in 3D) that has the segment as a diameter. This makes midpoints a building block for many constructions — perpendicular bisectors, medians of triangles, centers of rectangles, and finding the middle of a route or an object in space.
Interpreting the result is straightforward: if point \(A\) is \(A(2, 3)\) and point \(B\) is \(B(8, 7)\), the midpoint \(M(5, 5)\) sits at the same “middle” position along both the horizontal and the vertical direction. The segment length shown alongside tells you how far apart the endpoints are, which is often useful when you need both the center and the size of the segment.
Assumptions, limitations and tips
- The calculator uses the straight-line (Euclidean) distance for the segment length. On a map with real roads, the driving distance between the endpoints will be longer than the straight-line value.
- Coordinates can be negative, whole numbers or decimals — for example, the midpoint of \((-4, 1)\) and \((3, 6)\) is \((-0.5, 3.5)\).
- If both endpoints coincide, the midpoint equals that point and the segment length is 0.
- The midpoint is a special case of a weighted position: if you need a point that divides a segment in a different ratio (for example 1:2 instead of 1:1), you would weight the coordinates accordingly. The weighted mean is the general tool for that kind of problem, and a simple average calculator handles the underlying arithmetic.
- For a quick mental check: the midpoint must always lie between the two endpoints in every coordinate, so its X value must fall between \(x_1\) and \(x_2\), and similarly for Y (and Z in 3D).
Frequently Asked Questions
Can I find a missing endpoint if I know the midpoint and the other endpoint?
Yes — rearrange the midpoint formula. If the midpoint \(M(m_x, m_y)\) and endpoint \(A(x_1, y_1)\) are known, the missing endpoint is \(B = (2m_x - x_1,\ 2m_y - y_1)\). This is a very common textbook problem: the midpoint is the average of the endpoints, so each endpoint is twice the midpoint minus the other endpoint. The same trick works for the Z coordinate in 3D: \(z_2 = 2m_z - z_1\).
Does the order of the two points matter?
No, the result is identical either way. Averaging is commutative, so swapping point 1 and point 2 gives the same midpoint: \(\frac{x_1 + x_2}{2} = \frac{x_2 + x_1}{2}\). The segment length is also unaffected, since the differences are squared in the distance formula. Feel free to enter the points in any order.
Can I use latitude and longitude to find the midpoint of a route?
Only for a rough estimate. Averaging latitude and longitude directly works reasonably well for short distances near the equator, but it ignores the curvature of the Earth and distorts longitude at high latitudes. For accurate geographic midpoints, you need the great-circle method, which converts coordinates to radians, averages them as 3D unit vectors, and converts back. Also remember that the calculated straight-line midpoint of a trip is rarely on an actual road.
What is the difference between a midpoint and a centroid?
A midpoint is the center of a segment between exactly two points, while a centroid is the average position of any number of points (or of a whole shape). The centroid of two points coincides with their midpoint, but for three or more points you average all coordinates: \(C = \left(\frac{\sum x_i}{n}, \frac{\sum y_i}{n}\right)\). For example, the centroid of a triangle is the average of its three vertices, not the midpoint of any single side.
Why does averaging the coordinates give the midpoint?
It comes from similar triangles and the definition of a midpoint. If \(M\) is halfway between \(A\) and \(B\), then in each coordinate direction \(M\) must also be halfway, so \(m_x - x_1 = x_2 - m_x\). Solving this equation gives \(m_x = \frac{x_1 + x_2}{2}\), and the same reasoning applies to every other coordinate. This is why the formula generalizes to any number of dimensions.
What happens if the two points form a horizontal or vertical line?
Nothing special — the formula still works. For a horizontal segment, both endpoints share the same Y value, so the midpoint also has that Y value, and its X is the average of the two X values. Similarly, for a vertical segment, the midpoint's X equals the shared X value. A common mistake is expecting the midpoint to differ in every coordinate; in reality, some coordinates of the midpoint can match the endpoints exactly.
How is the midpoint formula used in geometry problems?
It appears constantly in constructions and proofs. The midpoint is the foot of every perpendicular bisector, it defines the medians of a triangle (which meet at the centroid), and it gives the center of a rectangle from its diagonal corners: the midpoint of the diagonal is the point where both diagonals cross. In coordinate proofs, you often find a midpoint and then check that the distance from it to each endpoint is exactly half the segment length.