Midpoint Calculator
Find the midpoint between two points in 2D or 3D with steps, plus the distance and slope. Also averages up to five points to give their centroid.
Calculate the midpoint of two points in 2D or 3D space, or the centroid (average position) of 3 to 5 points. The midpoint is the point exactly halfway between two points; for more than two points there is no single "halfway" point, so the calculator reports their centroid. It also gives distances and, for two 2D points, the slope.
Dimension Selection
Most People Ask for the Wrong Thing
When someone says they need a midpoint calculator, they often want the center of three or four points on a map. That is not a midpoint. A midpoint is defined for exactly two points, the point halfway between them on a straight line. For three or more points, the average position is called a centroid, and the two are not interchangeable. This tool gives you the midpoint of two points in 2D or 3D with the full working, and it tells you when you actually need a centroid instead.
Use the calculator above. Select 2D or 3D, enter two points, and it returns the midpoint coordinates, the distance from each endpoint to the midpoint, the slope (for 2D), and the step-by-step calculation. For three to five points it returns the centroid and labels it clearly so you never confuse the two.
- Midpoint Definition: The point exactly halfway between two endpoints of a line segment. Applies only to two points.
- 2D Formula: M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
- 3D Formula: M = ((x₁ + x₂)/2, (y₁ + y₂)/2, (z₁ + z₂)/2)
- Centroid (3+ Points): Average of all coordinates: (Σx/n, Σy/n, Σz/n). Not a midpoint.
- Common Core Reference: HSG-GPE.B.6: Find the point on a directed line segment between two given points that partitions the segment in a given ratio.
How to Use the Midpoint Calculator
Select your dimension first. 2D gives you x and y inputs for each point. 3D adds a z coordinate. Then choose the number of points: 2 for a true midpoint, 3 to 5 if you need the centroid of a cluster. The calculator labels the result accordingly.
Enter each coordinate. Use whole numbers, decimals, or fractions (the input accepts any numeric value). Set decimal places from 0 to 8. Check "Show distances" to see the distance from each point to the midpoint or centroid. Check "Show calculation steps" to see the full arithmetic. Click Calculate.
The results panel shows the midpoint (or centroid) coordinate, a table of all points with their distances, and a step-by-step breakdown. For two points in 2D it also gives the slope and the angle of inclination (0° to 180°). Use Reset to clear and start over.
What to Do With the Results
Copy the midpoint coordinate directly into your geometry problem, graphic design software, or navigation app. If you see "Centroid" instead of "Midpoint" in the results, the calculator is telling you that the average of three or more points is not a midpoint, use the centroid value only if that is what your problem asks for.
The Midpoint Formula: What It Is and Why It Works
The midpoint formula is a direct application of the arithmetic mean. For two points in a Cartesian coordinate system, the midpoint is the average of each coordinate separately. In 2D: add the x-values, divide by 2; add the y-values, divide by 2. In 3D: do the same for z. The result is the point that splits the line segment into two equal lengths.
The formula works because coordinates are linear. If you travel from one endpoint to the other along a straight line, the halfway point in terms of distance corresponds to the halfway point in terms of coordinate change. This is true regardless of the sign of the coordinates or the length of the segment.
For three or more points, the same averaging process gives the centroid, not a midpoint. The centroid minimizes the sum of squared distances to all points, but it does not lie on a line segment connecting any two of them (unless the points are collinear). Never call a centroid a midpoint, it is a different geometric object.
Worked Example: Negatives and Fractions
Take two points: A(-3, 2.5) and B(5, -1.75). Find the midpoint.
Step 1: Add the x-coordinates: -3 + 5 = 2. Divide by 2: 2/2 = 1. The x-coordinate of the midpoint is 1.
Step 2: Add the y-coordinates: 2.5 + (-1.75) = 0.75. Divide by 2: 0.75/2 = 0.375. The y-coordinate is 0.375.
Midpoint M = (1, 0.375). The calculation steps the calculator shows would list each addition and division explicitly, with the numbers as they appear.
Common failure: forgetting to handle the negative sign in -1.75. Students often write 2.5 - 1.75 = 0.75 (correct) but then skip the division by 2, or divide -3 + 5 by 2 and get 1 (correct) but misplace the sign on the y. The calculator prevents both errors by doing the arithmetic in full.
3D Example With Fractions
Points: C(1/2, -3/4, 2) and D(3/2, 5/4, -2). The calculator converts fractions to decimals: C(0.5, -0.75, 2), D(1.5, 1.25, -2). x: (0.5 + 1.5)/2 = 1. y: (-0.75 + 1.25)/2 = 0.25. z: (2 + (-2))/2 = 0. Midpoint M = (1, 0.25, 0). The step-by-step view shows each fraction's decimal equivalent and the averaging.
More Than Two Points: That Is a Centroid
If you enter three points into a midpoint calculator and it returns a single coordinate, that coordinate is the centroid, the average position of all points. It is not the midpoint of any line segment. A midpoint requires exactly two endpoints that define a segment. Three points form a triangle (or a line if collinear), and there is no single halfway point among them.
Use the centroid when you need the center of mass of a set of discrete points, the average location of a cluster in data analysis, or the geometric center of a triangle (the intersection of its medians, which coincides with the centroid of its vertices). The polygon area-centroid formula for a triangle gives the same point: (x₁ + x₂ + x₃)/3, (y₁ + y₂ + y₃)/3.
Do not use a centroid when you need the midpoint of a specific segment. If your problem says "find the midpoint of the segment from (1,2) to (5,6)", the answer is (3,4). If it says "find the average position of the three vertices of a triangle", the answer is the centroid, which is not a midpoint.
Three collinear points do not form a triangle, and their centroid is simply the weighted average along the line. For points (1,1), (3,3), (5,5), the centroid is (3,3) which is also the midpoint of the outer segment, but that is a coincidence of equal spacing, not a rule.
Where the Midpoint Gets Used: Geometry, Graphics, and Halfway Points
The midpoint is not a classroom-only tool. Here are three real applications where finding it matters:
Geometry
Find the center of a line segment for perpendicular bisectors, triangle midsegments, and coordinate proofs. The midpoint of the diagonal of a parallelogram is the same as the midpoint of the other diagonal, a property used to prove that the diagonals bisect each other. In coordinate geometry, you use the midpoint to find the center of a circle's diameter or to partition a directed segment in a given ratio (Common Core standard HSG-GPE.B.6).
Computer Graphics
Calculate the camera position between two objects for a balanced shot. Interpolate object centers for animation keyframes. The midpoint gives the exact halfway coordinate for smooth transitions. In 3D rendering, the midpoint of two vertices helps construct mesh subdivisions.
Navigation and Meetups
Find the geographic halfway point between two addresses. For short distances (under 100 km), the Euclidean midpoint on a Cartesian projection is close enough. For long distances, use the Haversine formula to calculate the great-circle midpoint, which accounts for Earth's curvature. The Movable Type Scripts reference gives the full spherical formula: lat_m = atan2(sin(lat1)+sin(lat2), sqrt((cos(lat1)+cos(lat2))^2 + (sin(lat1)-sin(lat2))^2)); lon_m = lon1 + atan2(sin(lon2-lon1), cos(lon1)+cos(lon2)).
Failure case: averaging latitude and longitude directly (like (lat1+lat2)/2, (lon1+lon2)/2) works only for points very close together. For transatlantic distances, the error can be hundreds of kilometers. Use the spherical formula or a dedicated geographic midpoint tool.
| Property | Midpoint (2 Points) | Centroid (3+ Points) |
|---|---|---|
| Definition | Halfway point of a line segment | Average position of all points in a set |
| Number of Points | Exactly 2 | 3 or more (any number) |
| Formula | ((x₁+x₂)/2, (y₁+y₂)/2) | (Σx/n, Σy/n, Σz/n) |
| Lies on Segment? | Yes, always | Only if points are collinear and equally spaced |
| Use Case | Bisectors, segment division, interpolation | Center of mass, cluster center, triangle centroid |
| Common Error | Calling it a centroid | Calling it a midpoint |
One Caveat Before You Rely on the Number
The midpoint formula assumes a flat, Euclidean space. That works for coordinate geometry and short geographic distances. For long distances on Earth, the Euclidean midpoint can be off by tens of kilometers because the Earth is curved. Use the Haversine formula for geographic midpoints. For very short distances (under 1 km), the Euclidean approximation is fine. The single thing that most often goes wrong: someone averages latitude and longitude directly for a transatlantic trip and gets a point hundreds of kilometers off the actual halfway path.
Common Questions
Can the midpoint calculator work in 3D?
Yes. Select 3D from the dimension dropdown. Each point gets a z coordinate input. The calculator uses the formula ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2) for two points. For three or more points in 3D, it averages each coordinate to give the centroid.
What happens if one or both coordinates are negative?
The midpoint formula handles negative coordinates exactly the same as positive ones. Add the coordinates (including the negative sign) and divide by 2. For example, the midpoint of (-5, -3) and (3, 7) is ((-5+3)/2, (-3+7)/2) = (-1, 2). The midpoint can have negative, zero, or positive coordinates depending on the endpoints.
Can the calculator handle fraction coordinates?
Yes. Enter fractions as decimals. The calculator accepts any numeric input. For 1/2, enter 0.5. For -3/4, enter -0.75. The step-by-step view shows the decimal equivalents as they are used in the arithmetic.
What is the difference between a midpoint and a centroid?
A midpoint is the point halfway between exactly two endpoints of a line segment. A centroid is the average position of three or more points. For two points they are the same. For three points, calling the average a midpoint is incorrect, it is a centroid. The distinction matters in geometry: a midpoint lies on the segment connecting the two points; a centroid of three non-collinear points lies inside the triangle but not on any side.
Can I use the midpoint to find a missing endpoint?
Yes. If you know one endpoint and the midpoint, solve for the missing endpoint. Given midpoint M(xₘ, yₘ) and endpoint A(x₁, y₁), the missing endpoint B is (2xₘ - x₁, 2yₘ - y₁). The calculator does not solve this directly, but you can use the formula manually. For example, if midpoint is (3, 4) and endpoint A is (1, 2), then B = (2*3-1, 2*4-2) = (5, 6).