Midpoint Calculator

Calculate the exact midpoint between two points in 2D or 3D space, plus the distance between them.

📍 Midpoint Calculator

Enter the coordinates of both endpoints to find the midpoint.

Enter the x, y, z coordinates of both endpoints in 3D space.

Midpoint
Midpoint X
Midpoint Y
Midpoint Z
Distance
Dimension

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:

M = ((x1 + x2) / 2, (y1 + y2) / 2)

In three-dimensional space, the formula extends naturally by adding the z-axis:

M = ((x1 + x2) / 2, (y1 + y2) / 2, (z1 + z2) / 2)

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

2D Midpoint:
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

1
Select a mode — Choose 2D Points for flat plane geometry or 3D Points for three-dimensional space.
2
Enter Point 1 — Type the x and y coordinates (and z for 3D) of the first endpoint.
3
Enter Point 2 — Type the coordinates of the second endpoint. Decimal and negative values are accepted.
4
Click Calculate — The calculator instantly shows the midpoint coordinates and the distance between the two points.
5
Read the results — The midpoint is displayed both as a full coordinate pair and as individual x, y, z values for easy use in further calculations.

Example Calculations

Example 1 — Basic 2D midpoint
1
Find the midpoint of A(2, 4) and B(8, 10).
2
Mx = (2 + 8) / 2 = 10 / 2 = 5
3
My = (4 + 10) / 2 = 14 / 2 = 7
4
Distance = sqrt((8-2)^2 + (10-4)^2) = sqrt(36 + 36) = sqrt(72) = 8.4853 units
5
Midpoint = (5, 7)
Try this example
Midpoint: (5, 7) | Distance: 8.4853 units
Example 2 — Points with negative coordinates
1
Find the midpoint of C(-3, 1) and D(5, -7).
2
Mx = (-3 + 5) / 2 = 2 / 2 = 1
3
My = (1 + (-7)) / 2 = -6 / 2 = -3
4
Distance = sqrt((5-(-3))^2 + (-7-1)^2) = sqrt(64 + 64) = sqrt(128) = 11.3137 units
5
Midpoint = (1, -3)
Try this example
Midpoint: (1, -3) | Distance: 11.3137 units
Example 3 — Decimal coordinates
1
Find the midpoint of P(1.5, 2.5) and Q(4.5, 6.5).
2
Mx = (1.5 + 4.5) / 2 = 6 / 2 = 3
3
My = (2.5 + 6.5) / 2 = 9 / 2 = 4.5
4
Distance = sqrt((4.5-1.5)^2 + (6.5-2.5)^2) = sqrt(9 + 16) = sqrt(25) = 5 units
5
Midpoint = (3, 4.5)
Try this example
Midpoint: (3, 4.5) | Distance: 5 units
Example 4 — 3D midpoint in space
1
Find the midpoint of P1(1, 3, 5) and P2(7, 9, 11).
2
Mx = (1 + 7) / 2 = 4
3
My = (3 + 9) / 2 = 6
4
Mz = (5 + 11) / 2 = 8
5
Distance = sqrt((7-1)^2 + (9-3)^2 + (11-5)^2) = sqrt(36+36+36) = sqrt(108) = 10.3923 units
6
Midpoint = (4, 6, 8)
Try this example
Midpoint: (4, 6, 8) | Distance: 10.3923 units

Frequently Asked Questions

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 x. Do the same for y (and z in 3D). For example, the midpoint of (2, 4) and (8, 10) is ((2+8)/2, (4+10)/2) = (5, 7). The idea is simply averaging each axis independently.
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 in both 2D and 3D modes.
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, not a line.
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 with a single click.
How is the distance between two points calculated?+
The distance uses the Euclidean (straight-line) formula derived from the Pythagorean theorem. In 2D: d = sqrt((x2-x1)^2 + (y2-y1)^2). In 3D: d = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). This calculator shows the distance alongside the midpoint so you have both in one step.
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. This property makes it useful for bisecting segments and finding centers.
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 (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 zero or equal.
How is the midpoint used in geometry problems?+
Midpoints are used to find centers of segments, construct perpendicular bisectors, identify centroids of triangles, bisect angles in proofs, and define the medians of triangles. They also appear in coordinate geometry to divide segments into equal parts and in computer graphics for midpoint line drawing algorithms.
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. The formula still works because (4+4)/2 = 4 and sqrt(0+0) = 0.
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. For all practical purposes the result is exact.
Can I use this calculator for map or GPS coordinates?+
You can enter 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) the difference is negligible. For large geographic distances, a spherical midpoint formula (haversine-based) is more accurate.

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.