Midpoint Calculator
Calculate the exact midpoint between two points in 2D or 3D space, plus the distance between them.
What is the Midpoint Formula?
The midpoint of a line segment is the point that lies exactly halfway between the two endpoints. It divides the segment into two equal halves, each with the same length.
In two-dimensional coordinate geometry, the midpoint M between points P1(x1, y1) and P2(x2, y2) is found by averaging the x-coordinates and averaging the y-coordinates separately:
In three-dimensional space, the formula extends naturally by adding the z-axis:
The midpoint formula is one of the most fundamental tools in coordinate geometry. It is used in construction, engineering, computer graphics, navigation, and everyday applications such as finding the center of a wall or the midpoint of a road segment.
The concept extends directly from the number-line midpoint formula: for two values a and b, the midpoint is (a + b) / 2. The 2D and 3D versions simply apply this idea to each coordinate axis independently.
Formula and Variables
Mx = (x1 + x2) / 2
My = (y1 + y2) / 2
3D Midpoint:
Mx = (x1 + x2) / 2
My = (y1 + y2) / 2
Mz = (z1 + z2) / 2
Distance (2D): d = sqrt((x2 - x1)^2 + (y2 - y1)^2)
Distance (3D): d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)
Variables:
- x1, y1 — coordinates of the first endpoint
- x2, y2 — coordinates of the second endpoint
- z1, z2 — z-coordinates used in 3D mode
- Mx, My, Mz — x, y, z coordinates of the midpoint
- d — straight-line (Euclidean) distance between the two points
The distance formula is derived from the Pythagorean theorem: the horizontal and vertical differences between two points form the legs of a right triangle, and the distance is the hypotenuse.
How to Use the Midpoint Calculator
Steps to Calculate
Example Calculations
Frequently Asked Questions
🔗 Related Calculators
What is the midpoint formula?
The midpoint formula gives the point exactly halfway between two endpoints. For points (x1, y1) and (x2, y2), the midpoint M is ((x1+x2)/2, (y1+y2)/2). In three dimensions, add the z-coordinate: M = ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2). You simply average each coordinate separately.
How do you find the midpoint between two points?
Add the x-coordinates of both points and divide by 2 to get the midpoint's x-coordinate. Do the same for the y-coordinates (and z-coordinates in 3D). For example, the midpoint of (2, 4) and (8, 10) is ((2+8)/2, (4+10)/2) = (5, 7).
Can the midpoint have negative coordinates?
Yes. If one or both endpoints have negative coordinates, the midpoint formula still applies. For example, the midpoint of (-3, 1) and (5, -7) is ((-3+5)/2, (1-7)/2) = (1, -3). Negative inputs are fully supported.
What is the difference between a midpoint and a bisector?
A midpoint is a single point that lies exactly halfway along a line segment. A perpendicular bisector is the line that passes through that midpoint at a right angle to the original segment. Every perpendicular bisector passes through the midpoint, but the midpoint itself is just one point.
Does the midpoint formula work in 3D space?
Yes. In three dimensions, the midpoint of (x1, y1, z1) and (x2, y2, z2) is ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2). You average each of the three coordinate axes independently. This calculator supports both 2D and 3D modes.
How is the distance between two points calculated?
The distance between (x1, y1) and (x2, y2) uses the Euclidean distance formula: d = sqrt((x2-x1)^2 + (y2-y1)^2). In 3D, add the z term: d = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). This calculator shows the distance alongside the midpoint.
Is the midpoint always on the segment connecting the two points?
Yes. By definition, the midpoint lies on the line segment between the two points, at equal distance from both endpoints. It is always on the segment, never outside it.
Can I use the midpoint formula for points on a number line?
Yes. A number line is one-dimensional, so the midpoint of two values a and b is simply (a+b)/2. For example, the midpoint of 3 and 11 is (3+11)/2 = 7. The 2D formula reduces to this when both y-coordinates are the same.
How is the midpoint used in geometry problems?
Midpoints are used to find the centers of segments, construct perpendicular bisectors, identify centroids of triangles, bisect angles in geometric proofs, and define the medians of triangles. They are also used in coordinate geometry to divide line segments into equal parts.
What happens if both points are the same?
If both endpoints are identical, such as (4, 4) and (4, 4), the midpoint is the same point (4, 4) and the distance between them is 0. This is a valid edge case and the calculator handles it correctly.
How accurate is the midpoint calculator?
Results are computed in JavaScript double-precision floating point (IEEE 754), which gives accuracy to approximately 15 significant digits. Displayed values are rounded to 4 decimal places for readability.
Can I use this calculator for map coordinates or GPS points?
You can use decimal degree coordinates as inputs, but the result is the arithmetic midpoint in degrees, not the geodesic midpoint on a sphere. For very short distances (a few kilometres) this difference is negligible. For large geographic distances, a proper spherical midpoint formula is more accurate.