Midpoint Calculator
This midpoint calculator finds the point halfway between two endpoints in a two-dimensional Cartesian plane. Enter x and y for each endpoint. For (2, 4) and (6, 10), the midpoint is (4, 7). The straight-line distance between those endpoints is approximately 7.21110255 coordinate units.
Loading calculator. JavaScript is required.
Your result
The midpoint calculator averages the x coordinates and the y coordinates separately. It also reports the endpoint distance as a check on the size of the segment. The calculation assumes a flat coordinate plane with compatible axis scales. It does not calculate a halfway point along a road or a shortest path across the curved surface of Earth.
On this page
How to use the midpoint calculator
Enter the first endpoint as x1 and y1, then the second as x2 and y2. Keep the coordinate order consistent: x is the horizontal coordinate and y is the vertical coordinate. Negative coordinates are valid. A minus sign changes the point's location, so copy it along with the number.
Use one coordinate system for both endpoints. If the coordinates represent distances, use compatible units and scales on the axes. Enter values as decimals without grouping commas. Calculate to see the two midpoint coordinates and the distance between the endpoints. The midpoint calculator works with the entered numerical coordinates; it does not infer a projection, map scale or physical unit.
The midpoint and distance formulas
For endpoints (x1, y1) and (x2, y2), the midpoint is ((x1 + x2)/2, (y1 + y2)/2). Averaging each pair places the result halfway along both coordinate differences. The formula treats the endpoints equally, so reversing the first and second point leaves the same midpoint.
The endpoint distance is the square root of (x2 - x1) squared plus (y2 - y1) squared. This is the Pythagorean distance in a Cartesian plane. The midpoint divides the segment into two equal lengths. Each half has half the endpoint distance, apart from ordinary numerical rounding. The displayed distance is the complete segment length, not the length of one half.
Three worked coordinate examples
Example one uses endpoints (2, 4) and (6, 10). The midpoint x coordinate is (2 + 6)/2 = 4, and its y coordinate is (4 + 10)/2 = 7. The coordinate differences are four and six. Their squared values add to fifty-two, so the endpoint distance is the square root of fifty-two.
Example two uses (-3, 5) and (7, -1). The midpoint is ((-3 + 7)/2, (5 - 1)/2) = (2, 2). The endpoint differences are ten and negative six. Squaring removes the sign in the distance formula, giving a total distance of the square root of one hundred thirty-six, approximately 11.66190379.
Example three uses (0, 0) and (8, 0). The midpoint is (4, 0), and the endpoint distance is eight. Because both y coordinates are zero, the whole segment lies on the horizontal axis. The formula still works without a separate rule for horizontal segments.
Check the halfway point in both directions
A useful check is to compare the displacement from the first endpoint to the midpoint with the displacement from the midpoint to the second endpoint. For the first example, both are two units in x and three units in y. Matching coordinate differences show that the midpoint splits the segment evenly. Moving both endpoints by the same coordinate offset moves the midpoint by that offset and leaves the endpoint distance unchanged.
The midpoint must also lie between the endpoint coordinates on each axis, including the endpoints when a coordinate is unchanged. If the endpoint x values are two and six, a midpoint x value outside that interval signals an input or arithmetic problem. This check applies separately to x and y and remains useful when one or both coordinates are negative.
Midpoint calculator limits and special cases
The midpoint calculator accepts zero or a signed finite coordinate whose magnitude is from 0.000000001 to 1,000,000,000. Inputs below that nonzero magnitude or above the maximum are outside this implementation's range. A blank field is not treated as zero. Enter an explicit zero when an endpoint lies on an axis.
The midpoint calculator accepts coincident endpoints. If both points are (2, 3), their midpoint is also (2, 3), and their distance is zero. Vertical segments work because averaging does not require dividing by the horizontal difference. Standard browser floating-point arithmetic can round a midpoint or distance, especially when the exact distance is irrational. Retain the inputs when a later calculation needs reproducibility.
Choose a method that matches the coordinate system
Latitude and longitude are angular coordinates on a curved surface. Taking their ordinary arithmetic average can give the wrong geographic midpoint, particularly near the date line. Use a geographic method with a stated Earth model for that purpose. This midpoint calculator is intended for ordinary planar coordinates, classroom geometry and compatible local Cartesian models.
The result from this midpoint calculator also differs from a halfway point along a route. A road may turn, cross a bridge or follow a boundary, so half its travel distance may not lie on the straight segment between endpoints. Keep the coordinate system, units and meaning of distance with any shared result. The numbers alone cannot establish which route or measurement system was intended.
Questions about midpoint calculator
What does the midpoint calculator return?
It returns the midpoint x coordinate, midpoint y coordinate and straight-line distance between two entered endpoints. The midpoint coordinates describe a location, while the distance describes the length of the complete segment. These are different kinds of results. Keep the coordinate system and unit assumptions beside them when using the values outside the form.
Can I enter negative coordinates?
Yes. Negative coordinates indicate positions on the other side of the selected origin. For endpoints (-3, 5) and (7, -1), the midpoint is (2, 2). Add the signed x values together before dividing by two, and do the same for y. Do not discard minus signs or average absolute values instead.
Does the order of the endpoints matter?
No. Swapping the two endpoints leaves their coordinate sums unchanged, so it leaves the midpoint unchanged. The endpoint distance is also unchanged because the coordinate differences are squared. Reversing the endpoints is a useful arithmetic check. It does not change the underlying segment or make the halfway point move to a different location.
What happens if both endpoints are the same?
The midpoint is that same point, and the endpoint distance is zero. This is a valid degenerate segment for a midpoint calculation. For example, (2, 3) and (2, 3) give midpoint (2, 3). A separate slope calculation would not determine a unique line from those coincident points, but averaging the coordinates is still well defined.
Can the midpoint be outside the two endpoint coordinates?
For ordinary real coordinates, its x value is between the endpoint x values and its y value is between their y values. The complete midpoint lies on the segment joining the points. If a copied result falls outside one of these coordinate intervals, check the signs, field order and arithmetic before using it.
Does this work for a vertical or horizontal segment?
Yes. If the two x coordinates match, their average is the same x coordinate, giving a vertical segment midpoint. If the y coordinates match, the midpoint keeps that y coordinate. No division by the horizontal or vertical difference is required, so both cases use the ordinary averaging formula without a slope exception.
Is the distance output the length of half the segment?
No. The distance output is the length from the first endpoint to the second endpoint. The midpoint divides that segment into two equal parts, so each part has half the reported endpoint distance. For points (0, 0) and (8, 0), the displayed distance is eight and each midpoint-to-endpoint distance is four.
Can I use latitude and longitude as x and y?
Use a geographic midpoint method instead when coordinates represent positions on Earth. Latitude and longitude are angles, and a simple average does not account for a curved Earth or longitude wrapping at the date line. This form applies a flat Cartesian model. A local projected coordinate system may be suitable only when its assumptions and scale fit the task.
Why might the displayed distance be rounded?
The square root of a non-square number often has an infinite decimal expansion. Browser floating-point arithmetic and the display format retain only a finite approximation. For endpoints (2, 4) and (6, 10), the exact distance is the square root of fifty-two. Keep that expression or the original coordinates when later work needs more precision than the displayed decimal.
Can I find a point one third of the way along a segment?
This form returns the halfway point only. A different fraction requires a weighted coordinate calculation, such as x1 + t(x2 - x1) and y1 + t(y2 - y1), with t equal to the desired fraction. The midpoint corresponds to t = 0.5. Do not treat the ordinary average as a general division ratio.
What should I keep with a result I share?
Keep both ordered endpoint pairs, their coordinate system, axis scales, physical units if relevant and whether distance means the straight segment. A midpoint such as (4, 7) has little context on its own. Preserving these details lets another person reproduce the calculation and decide whether the flat Cartesian assumptions suit the intended task.
Sources and method notes
Method and source notes checked on 26 November 2026. The diagrams are original explanatory drawings. Read the privacy policy for other site services.