Midpoint Calculator - 2D and 3D Coordinate Midpoint

Use this midpoint calculator to compute the center of a line segment from two (x, y) endpoints, with segment length, slope, and the averaging formula.

Updated: June 16, 2026 • Free Tool

Midpoint Calculator

Choose 2D for plane (x, y) work or 3D for (x, y, z) work.

x-coordinate of the first endpoint of the segment.

y-coordinate of the first endpoint of the segment.

x-coordinate of the second endpoint of the segment.

y-coordinate of the second endpoint of the segment.

z-coordinate of the first endpoint. Only used in 3D mode.

z-coordinate of the second endpoint. Only used in 3D mode.

Results

Midpoint
0
Midpoint x 0
Midpoint y 0
Midpoint z (3D only) 0
Segment distance 0
Slope (Δy / Δx) 0

What Is the Midpoint Calculator?

The midpoint calculator finds the point that lies exactly halfway between two given points in the Cartesian coordinate system. You enter the coordinates of each endpoint, and the tool returns the midpoint, the length of the segment, and the slope of the line that connects them. It works in 2D using (x, y) inputs and in 3D using (x, y, z) inputs, so you can use it for plane geometry, triangle centroid calculations, and basic vector work.

  • Coordinate geometry homework: Confirm the midpoint of a segment when a problem asks for an average of two coordinates, or when a follow-up step needs the segment length or slope.
  • Triangle and quadrilateral work: Compute the side midpoints of a triangle or a quadrilateral, which feed into centroid and medial-triangle calculations.
  • Map, CAD, and design layout: Place the center of a wall, the center of a pipe run, or the center of a feature by averaging the coordinates of its two endpoints.
  • Quick data check: Cross-check a manual average or verify a result from another tool, especially when one endpoint has decimal or negative coordinates.

The midpoint of a line segment is the point that is the same distance from each endpoint. In analytic geometry, that point has the coordinates (x1 + x2) / 2 for x and (y1 + y2) / 2 for y, which is the same as taking the average of the two endpoints in each axis. The averaging works in any dimension, so a third coordinate z1, z2 is handled with (z1 + z2) / 2 as well.

For a problem that needs the straight-line length of the same pair of endpoints, the 2D distance calculator returns the Euclidean distance in one entry.

How the Midpoint Calculator Works

The calculator applies the standard midpoint formula to the coordinates you provide. In 2D, the x midpoint is the average of x1 and x2, and the y midpoint is the average of y1 and y2. Segment length and slope come from the same pair of endpoints.

M = ((x1 + x2) / 2, (y1 + y2) / 2)
  • x1, y1: Coordinates of the first endpoint. Add z1 in 3D mode.
  • x2, y2: Coordinates of the second endpoint. Add z2 in 3D mode.
  • M: Resulting midpoint, written as (x, y) in 2D or (x, y, z) in 3D.
  • d: Segment length, the square root of (Δx)² + (Δy)² (plus (Δz)² in 3D).

The distance from the midpoint to either endpoint is half of the segment length, which is a quick way to confirm the result by hand. For a vertical segment, Δx is zero and the slope is reported as undefined. For a horizontal segment, Δy is zero and the slope is 0. Both cases are handled without a divide-by-zero error.

Worked example: midpoint of (2, 4) and (6, 10)

Point 1: (2, 4), Point 2: (6, 10)

Midpoint x = (2 + 6) / 2 = 4. Midpoint y = (4 + 10) / 2 = 7. Distance = sqrt(4² + 6²) = sqrt(52) ≈ 7.2111. Slope = 6 / 4 = 1.5.

Midpoint (4, 7), segment length ≈ 7.2111, slope 1.5

The point (4, 7) sits exactly halfway between (2, 4) and (6, 10), and the same averaging rule extends to 3D: the midpoint of (1, 2, 3) and (5, 6, 9) is (3, 4, 6) with segment length ≈ 8.2462.

According to Omni Calculator, The midpoint of (2, 4) and (6, 10) is (4, 7) by averaging each pair of coordinates, and the same approach extends to triangle centroid work.

When the segment lives in three dimensions, the 3D distance calculator handles the same (Δx, Δy, Δz) calculation without having to switch tools.

Key Concepts Behind the Midpoint

A few geometric ideas make the midpoint formula easier to read in context, especially when the result is a building block for a larger problem.

Equidistance property

The midpoint is the only point on the segment that is the same distance from both endpoints. The segment from the midpoint to point 1 has the same length as the segment from the midpoint to point 2.

Coordinate average

Each midpoint coordinate is the arithmetic mean of the matching endpoint coordinate. The x midpoint depends only on the x endpoints, and the y midpoint depends only on the y endpoints.

Segment bisector

The midpoint is the point that bisects the segment, splitting it into two equal halves. The perpendicular bisector of a segment is the line through the midpoint that runs at right angles to the segment.

Midpoint versus centroid

The midpoint is the center of a single segment. The centroid of a triangle is the common intersection of the three medians, each of which passes through the midpoint of one side.

These four ideas are the same averaging property expressed in different ways. The medial triangle of any triangle, for example, is built from the midpoints of its sides.

For the related problem of finding the balance point of a triangle, the centroid calculator uses the same averaging idea on three vertices instead of two endpoints.

How to Use This Midpoint Calculator

The calculator runs as you type, so you can change any coordinate and watch the midpoint, distance, and slope update immediately. A reset button restores the default endpoints.

  1. 1 Enter the first endpoint: Type the (x, y) coordinates of the first endpoint into x₁ and y₁. Use a negative sign if the point lies left of the y-axis or below the x-axis.
  2. 2 Enter the second endpoint: Type the (x, y) coordinates of the second endpoint into x₂ and y₂. Decimals are accepted.
  3. 3 Switch to 3D if needed: When the problem has a z-axis, change the mode to 3D and set z₁ and z₂. The midpoint label switches to (x, y, z).
  4. 4 Read the midpoint: The combined midpoint appears at the top of the result panel, with separate x, y, and z values just below.
  5. 5 Check the companion outputs: The distance from the midpoint to either endpoint should equal half of the segment length.
  6. 6 Reset for a new problem: Click Reset to restore the default endpoints. The calculator recomputes the result automatically after a reset.

Given the endpoints (2, 4) and (6, 10), enter 2 and 4 into x₁ and y₁, and 6 and 10 into x₂ and y₂. The midpoint panel reports (4, 7) with a distance of about 7.2111 and a slope of 1.5, which matches the manual calculation.

If the result is going to be read as a grade or a roof pitch, the slope percentage calculator turns the same rise over run into a percentage.

Benefits of Using This Midpoint Calculator

The midpoint of a line segment shows up in geometry, design, and data work. Using the calculator gives a fast result with the same intermediate quantities you would check by hand.

  • No need to memorize the formula: The calculator applies (x1 + x2) / 2 and (y1 + y2) / 2 correctly even with decimals or negative values, and the result sits next to the inputs.
  • Midpoint, distance, and slope in one place: One entry of coordinates gives the midpoint, the Euclidean segment length, and the slope of the line through the endpoints.
  • Works for 2D and 3D: A 3D toggle adds the z-axis, so the same tool handles plane geometry and three-dimensional vector or physics problems.
  • Catches edge cases automatically: Vertical segments, horizontal segments, and identical endpoints all return a clean result, with 'undefined' shown for the slope of a vertical segment.
  • Live recalculation as you type: The result updates within a fraction of a second of any input change, so you can iterate through a list of endpoint pairs without clicking a button.

The biggest practical benefit is consistency across coordinate systems. The same (a + b) / 2 averaging rule applies on every axis, whether the problem is on a 2D coordinate plane or a 3D vector.

When the same endpoints are also used to report a segment length, the length of a line segment calculator gives the same number with a focused two-field workflow.

Factors That Affect the Midpoint Result

The midpoint formula is straightforward, but a few details change the way the result should be read and used in a larger problem.

Sign and order of coordinates

The midpoint depends on both the sign and the order of each coordinate. Swapping the two endpoints gives the same midpoint, but reversing the sign of an axis changes where the midpoint sits relative to the origin.

Mixing 2D and 3D inputs

The midpoint in 3D mode uses (z1 + z2) / 2, while 2D mode ignores the z fields. Switching modes does not change the x and y midpoints, but the z row only appears in the 3D result panel.

Vertical and horizontal segments

A vertical segment (x1 = x2) makes the slope undefined, and a horizontal segment (y1 = y2) makes the slope 0. The midpoint, distance, and other rows still work in both cases.

Rounding for display

The visible midpoint values are rounded to four decimal places. Internal calculations keep full precision, but the screen loses digits beyond that, which can matter for very large or very small coordinates.

  • The calculator finds the midpoint of a straight line segment, not the centroid of a curved arc or the balance point of a non-uniform shape. Use a centroid tool when the problem is about a triangle or a region with area.
  • Inputs are treated as Cartesian coordinates. Polar, spherical, or latitude and longitude coordinates need to be converted to (x, y) or (x, y, z) before the midpoint is meaningful.

The most common source of a 'wrong' midpoint is mixing the two endpoints. A quick sanity check is to confirm that the midpoint coordinate on each axis lies between the two endpoint coordinates on that axis.

According to Wikipedia (Midpoint), The midpoint of a segment in n-dimensional space is (A + B) / 2, with each coordinate averaging the matching pair of endpoint coordinates.

For the next step in a typical coordinate-geometry problem, the area of a triangle from coordinates calculator uses three vertices, including two of the endpoints from this midpoint problem, to return the triangle area.

Midpoint calculator showing two endpoints on a coordinate plane, the (x1+x2)/2 averaging formula, and the resulting midpoint coordinates.
Midpoint calculator showing two endpoints on a coordinate plane, the (x1+x2)/2 averaging formula, and the resulting midpoint coordinates.

Frequently Asked Questions

Q: How do I find the midpoint of two points?

A: Label the coordinates of the two endpoints as (x1, y1) and (x2, y2). Add the two x-coordinates and divide by 2 to get the x midpoint, then add the two y-coordinates and divide by 2 to get the y midpoint. The pair of results is the midpoint of the segment.

Q: What is the midpoint formula in coordinate geometry?

A: The midpoint formula is M = ((x1 + x2) / 2, (y1 + y2) / 2). In 3D, extend the same rule to the z-axis to get ((x1 + x2) / 2, (y1 + y2) / 2, (z1 + z2) / 2). The midpoint is the point that is equidistant from both endpoints.

Q: Can the midpoint be a decimal or fraction?

A: Yes. Each midpoint coordinate is an arithmetic mean of two endpoint coordinates, so decimals and fractions are normal results. The calculator shows up to four decimal places, and the underlying computation keeps full JavaScript precision.

Q: How is the midpoint different from the centroid of a triangle?

A: The midpoint is the center of a single segment between two endpoints. The centroid of a triangle is the point where its three medians meet; each median runs from a vertex to the midpoint of the opposite side. The centroid uses three midpoints, while the midpoint formula uses only two endpoints.

Q: What if the two points are the same?

A: If both endpoints are the same point, the midpoint is that same point, the segment length is 0, and the slope is reported as undefined because there is no direction along the segment. The calculator handles this case without dividing by zero.

Q: What other quantities does the midpoint help me compute?

A: From the same pair of endpoints, the calculator also reports the Euclidean segment length and the slope of the line through the endpoints. Those companion outputs are useful for triangle area, parallel-and-perpendicular-line checks, and centroid problems.