Midpoint Calculator
The midpoint of (0, 0) and (4, 6) is (2, 3). This midpoint calculator finds the point that sits exactly halfway between two points on a 2D coordinate plane. Enter the x and y coordinates of both points, and the tool averages the two x values and averages the two y values to return the midpoint coordinates. The midpoint formula, M = ((x1 + x2) / 2, (y1 + y2) / 2), shows up throughout geometry coursework, coordinate proofs, and any layout task where you need to locate the center of a line segment, such as finding the center of a rectangle from its diagonal corners or checking that a graphed segment is split evenly. Results are calculated instantly and rounded to 4 decimal places, so the calculator handles whole numbers, negative values, and decimals the same way.
Quick answer
The midpoint is the point that sits exactly halfway between two points on a coordinate plane.
What this tells you
- •The midpoint is the point that sits exactly halfway between two points on a coordinate plane.
- •You find its x value by averaging the two x-coordinates: (x1 + x2) / 2.
- •You find its y value by averaging the two y-coordinates: (y1 + y2) / 2.
- •The midpoint always lies on the straight line segment connecting the two points, at its exact center.
- •Negative coordinates work the same way. Adding a negative value simply lowers the sum before it is divided by 2.
- •Results are rounded to 4 decimal places, so long or repeating decimals display as a clean, readable number.
How to Use
- 1Enter the x and y coordinates of the first point (x1, y1). These can be positive, negative, or decimal values.
- 2Enter the x and y coordinates of the second point (x2, y2) using the same format.
- 3Double-check that you have not swapped an x value with a y value, since the calculator treats each field separately.
- 4Click Calculate to get the midpoint between the two points, shown as an (x, y) coordinate pair.
- 5Use the midpoint x and y values shown separately if you only need one coordinate, such as the center height of a vertical segment.
How It Works
Formula
M = ((x1 + x2) / 2, (y1 + y2) / 2)The midpoint formula averages each coordinate separately. Here, (x1, y1) is the first point and (x2, y2) is the second point. Add the two x values and divide by 2 to get the midpoint's x-coordinate, then add the two y values and divide by 2 to get the midpoint's y-coordinate. The resulting pair, M, is the point that lies exactly halfway along the straight line segment connecting the two original points, both in horizontal distance and vertical distance. This works because averaging two numbers always returns the value exactly between them, so walking from x1 to x2 reaches the midpoint x value after covering half that distance. The formula assumes a flat 2D Cartesian plane where each unit represents an equal step in both directions, and it does not require the two points to be entered in any particular order, since addition is commutative and (x1 + x2) always equals (x2 + x1).
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Midpoint of (0, 0) and (4, 6)
Average the x values: (0 + 4) / 2 = 2. Average the y values: (0 + 6) / 2 = 3. The midpoint is (2, 3), which is the exact center of the line segment connecting the two points.
Midpoint of (2, 3) and (8, 7)
Average the x values: (2 + 8) / 2 = 5. Average the y values: (3 + 7) / 2 = 5. The midpoint is (5, 5), a useful check when confirming a graphed line segment's center by hand.
Midpoint with negative coordinates: (-2, -4) and (2, 4)
Average the x values: (-2 + 2) / 2 = 0. Average the y values: (-4 + 4) / 2 = 0. The midpoint lands on the origin, which shows how a negative coordinate cancels out a positive one instead of making the sum smaller in the wrong direction.
Finding the center of a rectangle's diagonal
A rectangle with corners at (0, 0) and (12, 8) has a diagonal running between those two corners. Average the x values: (0 + 12) / 2 = 6. Average the y values: (0 + 8) / 2 = 4. The midpoint (6, 4) is the exact center of the rectangle, and the same method locates the center of any parallelogram from two opposite corners.
Midpoint with decimal coordinates
Average the x values: (1.23456 + 1.23457) / 2 = 1.234565, which rounds to 1.2346 at 4 decimal places. Average the y values: (1.5 + 2.7) / 2 = 2.1. This example shows how the calculator rounds a long decimal result to a clean, readable value without changing the underlying math.
Scenario: Lena proves ABCD is a parallelogram with two midpoints
Lena's geometry worksheet gives the vertices A(-3, 1), B(4, 2), C(7, 8), and D(0, 7) and asks for a coordinate proof that ABCD is a parallelogram. A quadrilateral is a parallelogram exactly when its diagonals bisect each other, so she finds the midpoint of each diagonal. Diagonal AC gives ((-3 + 7) / 2, (1 + 8) / 2) = (2, 4.5), and diagonal BD gives ((4 + 0) / 2, (2 + 7) / 2) = (2, 4.5). Both diagonals share the point (2, 4.5), so each cuts the other in half and the proof is done. On her first try she copied D as (0, 6), and run 2 returned (2, 4). That half-unit miss sent her back to the worksheet before she wrote a wrong conclusion.
Midpoints as this calculator prints them, including the rounding edge cases
Each midpoint is the tool's own output for that pair. The first rows cover signs, halves, repeated runs, and screen pixels. The rest show where 4-decimal rounding and map coordinates can surprise you.
| Point 1 (x1, y1) | Point 2 (x2, y2) | Midpoint shown | What the row shows |
|---|---|---|---|
| (0, 0) | (4, 6) | (2, 3) | Even sums divide cleanly |
| (1, 2) | (4, 7) | (2.5, 4.5) | Odd sums end in .5 and are still exact |
| (-3, 5) | (7, -1) | (2, 2) | Mixed signs cancel part of each sum |
| (-8, -3) | (-2, -11) | (-5, -7) | Two negative points give a negative midpoint |
| (-3, 5) | (2, 2) | (-0.5, 3.5) | Second run on the (-3, 5) to (7, -1) segment: the quarter point |
| (2, 2) | (7, -1) | (4.5, 0.5) | Second run on the same segment: the three-quarter point |
| (0, 0) | (1920, 1080) | (960, 540) | Center of a 1920 by 1080 screen in pixel coordinates |
| (0.1, 0.2) | (0.2, 0.4) | (0.15, 0.3) | Rounding cleans up the raw binary result 0.15000000000000002 |
| (0, 0) | (0.0003, 0) | (0.0001, 0) | True midpoint 0.00015 is stored just under the half, so it rounds down |
| (0.0001, 0) | (0.0002, 0) | (0.0002, 0) | The same true midpoint is stored just over the half, so it rounds up |
| (0, 0) | (0.0625, -0.0625) | (0.0313, -0.0313) | An exact binary half (0.03125) rounds away from zero on both signs |
| (0, 0) | (0.00009, -0.00009) | (0, 0) | Any midpoint closer to zero than 0.00005 prints as 0 |
| (170, 0) | (-170, 0) | (0, 0) | Longitudes 170°E and 170°W on the equator: the real halfway point is 180°, not 0° |
| (0, 60) | (90, 60) | (45, 60) | Longitude as x, latitude as y at 60°N: on a sphere the midpoint is about (45, 67.79) |
Every midpoint cell is this calculator's output, checked by running the live formula. It adds each pair of coordinates in IEEE 754 double precision, halves the sum, and rounds with Number.prototype.toFixed(4), which ECMA-262 defines as rounding the exact stored binary value and, at an exact tie, taking the larger magnitude. That is why the two 0.00015 rows print different results. The quarter and three-quarter rows feed the (2, 2) midpoint back in. The sphere point in the last row comes from the great-circle midpoint (the normalized sum of the two points' unit vectors on a sphere), not from this tool.
Section formula, map coordinates, and rounding
The midpoint formula is the halfway case of a more general rule. A point a fraction t of the way from (x1, y1) to (x2, y2) sits at x = x1 + t(x2 - x1) and y = y1 + t(y2 - y1). Set t to 1/2 and those simplify to (x1 + x2) / 2 and (y1 + y2) / 2. Written as a ratio, the same rule is the section formula. The point that splits the segment into parts in the ratio m:n is ((n × x1 + m × x2) / (m + n), (n × y1 + m × y2) / (m + n)), and m = n = 1 gives the midpoint again. Both show up in school standards. Common Core's HSG-GPE.B.6 asks students to find the point that partitions a directed segment in a given ratio. Texas geometry, 19 TAC 111.41(c)(2)(A) and (B), asks for the point a given fractional distance along a segment, including the midpoint, and for deriving and using the midpoint formula.
This calculator does only the 1:1 split, but you can reach more points by feeding its answer back in. From (-3, 5) to (7, -1) the midpoint is (2, 2), and the midpoint of (-3, 5) and (2, 2) is (-0.5, 3.5), the quarter point. Halving again gives eighths and sixteenths but never thirds or fifths, since repeated halving only makes fractions over a power of 2. For the point one third of the way from (-3, 5), use the section formula with m:n = 1:2. That gives x = (2 × -3 + 7) / 3 = 1/3, about 0.3333, and y = (2 × 5 - 1) / 3 = 3. Matching midpoints also prove things. A quadrilateral is a parallelogram exactly when its diagonals bisect each other, so two runs that return the same point settle the kind of coordinate proof HSG-GPE.B.4 describes, as Lena's worked example shows.
Latitude and longitude are angles on a curved surface, so averaging them is a shortcut, not the geographic midpoint. Two things go wrong. Longitude wraps at 180 degrees, so 170°E and 170°W on the equator average to 0°, on the far side of the planet, while the real halfway point is at 180°. And away from the equator, a parallel of latitude is not the shortest path on a globe. The shortest route between two points on it bows toward the pole, where degrees of longitude are shorter. Enter 60°N 0° and 60°N 90°E with longitude as x and latitude as y, and the tool returns (45, 60). On a sphere the great-circle midpoint is 67.79°N 45°E, 7.8 degrees farther north. Over short distances the gap is tiny. For two points one degree of longitude apart at 40°N it is about 0.001 degrees. For real routes, use a great-circle formula or, on an ellipsoidal Earth model, a geodesic method such as the algorithms in Karney's 2013 paper in the Journal of Geodesy.
Inside the tool, the coordinates are added in IEEE 754 double precision, the number format ECMA-262 specifies for JavaScript, then halved and rounded to 4 decimal places with Number.prototype.toFixed. Halving is exact in binary, and whole numbers up to 2^52 (about 4.5 quadrillion) add without error, so integer coordinates always give exact midpoints, .5 included. Decimals are different because values like 0.1, 0.2, and 0.0003 have no exact binary form. The raw midpoint of 0.1 and 0.2 is 0.15000000000000002, which the rounding cleans up to 0.15. The rounding can tip either way when the true midpoint has a 5 in the fifth decimal place, since ECMA-262 has toFixed round the stored binary value. So 0 and 0.0003 print 0.0001, while 0.0001 and 0.0002, with the same true midpoint of 0.00015, print 0.0002. If the fifth decimal matters, scale first. Enter 0 and 3 in ten-thousandths, get 1.5, and divide by 10,000 to read 0.00015.
Common mistakes
- Subtracting the coordinates instead of averaging them. The midpoint formula adds the values and divides by 2, so use (x1 + x2) / 2, not x2 - x1.
- Mixing the distance formula with the midpoint formula. The midpoint averages the coordinates, while the distance formula squares the differences, so they give different answers.
- Sign errors with negative coordinates. When a coordinate is negative, adding it lowers the sum, so (-2 + 2) / 2 = 0, not 2.
- Swapping an x value with a y value. Entering y1 into the x1 field shifts both coordinates of the result, so keep the horizontal and vertical values in their matching fields.
- Forgetting to divide by 2. Adding (x1 + x2) gives the sum of the two x values, not the midpoint x value, so the division step is required every time.
- Rounding the input coordinates before calculating. Round only the final midpoint, since rounding x1 or y1 first can shift the result by a small but real amount, especially with repeating decimals.
Embed this calculator on your site
Paste this code where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use as long as the credit line stays in place.
<script src="https://calctide.com/embed.js" data-tool="midpoint-calculator" async></script>
<p style="font-size:12px;margin:4px 0 0">Midpoint Calculator by <a href="https://calctide.com/education-math/midpoint-calculator/">CalcTide</a></p>Preview the embed at /embed/midpoint-calculator/.