Midpoint Calculator – Find the Center of Any Line Segment
The midpoint of a line segment is the point that divides it into two equal halves. Whether you are working on a geometry assignment, designing a layout, programming a graphics engine, or bisecting a route on a map, the midpoint formula gives you the exact center coordinate with no guesswork.
The Midpoint Formula
Given two points (x₁, y₁) and (x₂, y₂) in the Cartesian plane, their midpoint M is:
M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)
In plain language: average the two x-values to get Mx, and average the two y-values to get My. The result is the coordinate that sits exactly halfway along the segment.
Step-by-Step Example
Suppose Point 1 is (2, 4) and Point 2 is (8, 10).
- Mx = (2 + 8) / 2 = 10 / 2 = 5
- My = (4 + 10) / 2 = 14 / 2 = 7
- Midpoint = (5, 7)
You can verify this visually: the point (5, 7) lies exactly on the line between (2, 4) and (8, 10), dividing it into two segments of equal length.
Negative and Decimal Coordinates
The midpoint formula works identically for all real numbers. Points in any quadrant of the Cartesian plane — including negative coordinates and decimal values — are fully supported.
- Points (-3, -5) and (7, 1): midpoint = ((-3 + 7) / 2, (-5 + 1) / 2) = (2, -2)
- Points (1.5, 2.5) and (4.5, 6.5): midpoint = ((1.5 + 4.5) / 2, (2.5 + 6.5) / 2) = (3, 4.5)
Segment Length as Bonus Output
In addition to the midpoint, the calculator displays the segment length— the straight-line (Euclidean) distance between your two input points:
d = √((x₂ − x₁)² + (y₂ − y₁)²)
Having the segment length alongside the midpoint is useful when you need to split a known distance in half, check if a bisecting point falls within a required radius, or verify the geometry of a shape.
Common Applications
- Geometry problems – finding the center of a triangle's side (used in midsegment theorems and centroid calculations)
- Computer graphics – computing the center of a line, bounding box, or sprite for positioning and collision detection
- Engineering and architecture – locating the midpoint of beams, pipelines, or structural members for load analysis
- Mapping and navigation – finding the halfway point between two geographic locations when converting them to a flat coordinate system
- Data visualization – centering labels between two data points on a chart
Degenerate Cases
When both points share the same x-coordinate, the segment is vertical and Mx = x₁ = x₂. When they share the same y-coordinate, the segment is horizontal and My = y₁ = y₂. If both coordinates are identical, the segment has zero length and the midpoint equals that single point — all of which this calculator handles without error.
Precision and Rounding
Results are computed using JavaScript's 64-bit floating-point arithmetic, which provides roughly 15 significant digits. Outputs are displayed to 4 decimal places with trailing zeros removed, so 3.0000 is shown as 3 and 4.5000as 4.5. You can copy any result to the clipboard with the copy button next to each value.