Midpoint Calculator

Midpoint
Next

The midpoint between two points is the point whose coordinates are the averages of the two endpoints’ coordinates. Enter (x1, y1) and (x2, y2) for 2D, or add z-values for 3D, and the calculator returns the midpoint, the distance between the two points, and the slope of the line segment connecting them (useful when the midpoint is a step toward a perpendicular bisector problem).

How the midpoint is computed

  1. 1

    Enter point A

    (x1, y1) for 2D, (x1, y1, z1) for 3D.

  2. 2

    Enter point B

    (x2, y2) or (x2, y2, z2) with matching dimension.

  3. 3

    Read the midpoint

    Average the coordinates: ((x1+x2)/2, (y1+y2)/2, ...).

  4. 4

    Read distance and slope

    Distance via the distance formula; slope from rise over run.

The formula

2D midpoint:

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

3D midpoint:

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2, (z₁ + z₂) / 2)

It’s just the mean of each coordinate treated independently.

Worked examples

2D: A = (2, 3), B = (8, 7).

  • x-midpoint: (2 + 8) / 2 = 5
  • y-midpoint: (3 + 7) / 2 = 5
  • M = (5, 5)

3D: A = (1, 2, 3), B = (7, 4, 11).

  • x: (1 + 7) / 2 = 4
  • y: (2 + 4) / 2 = 3
  • z: (3 + 11) / 2 = 7
  • M = (4, 3, 7)

Related quantities the tool also shows

Distance between the two points:

2D: d = √((x₂−x₁)² + (y₂−y₁)²)

3D: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)

Slope (2D only):

slope = (y₂ − y₁) / (x₂ − x₁)

Vertical line (x₁ = x₂) has undefined slope.

Where midpoints come up

  • Geometry homework. Finding the center of a line segment; step in constructing a perpendicular bisector or a median of a triangle.
  • Coordinate geometry proofs. Showing a figure is a parallelogram or that diagonals bisect each other.
  • Physics. Center of mass of two equal point masses; halfway point of a trajectory.
  • Game development. Lerping between two positions at t = 0.5 gives the midpoint.
  • GIS and mapping. Approximating “between two places” for location-picker UI.

For more than two points

Midpoint is the mean of two points. For the centroid of three or more points, average all the coordinates:

Centroid = ((x₁ + x₂ + ... + xₙ) / n, (y₁ + ... + yₙ) / n, ...)

Same idea, applied across all points.

Sign and quadrant notes

The midpoint can land in a different quadrant than either endpoint when signs cancel. Example: A = (−3, 2), B = (3, −4). Midpoint = (0, −1), on the axis and below y=0. Always keep signs in mind; the calculator handles negatives correctly.

Frequently Asked Questions

Not directly with this formula, latitude/longitude are spherical coordinates. Averaging lat and lon works OK for points within a few kilometers but fails across long distances (especially near the poles or across the International Date Line). Use a great-circle midpoint formula for distances over a few hundred km.

Convert to Cartesian first: x = r·cos(θ), y = r·sin(θ). Midpoint the Cartesians, then (optionally) convert back to polar.

Yes, the midpoint lies exactly halfway along the straight line between A and B. It’s on the segment by definition.

It doesn’t directly. The midpoint bisects a line segment, not an angle. To bisect an angle, you use angle-bisector constructions involving equal-length rays from the vertex.

Related Tools

Tool available in other languages