Midpoint Calculator

Your values

Find
Dimensions
Point A
Point B

Coordinates can be whole numbers, decimals or fractions such as 1/3.

Result

Midpoint M

Distance from A to B
Exact distance
4√5
Distance from A to M
4.472135955

Step by step

  1. Average each coordinate of the two endpoints.
    M=(x1+x22, y1+y22)M=\left(\frac{x_1+x_2}{2},\ \frac{y_1+y_2}{2}\right)
  2. Substitute the coordinates.
    M=(−2+62, 3+(−1)2)=(2, 1)M=\left(\frac{-2+6}{2},\ \frac{3+\left({-1}\right)}{2}\right)=\left(2,\ 1\right)
  3. For the distance, square the coordinate differences, add them and take the square root.
    d=82+(−4)2=80=45≈8.944272d=\sqrt{8^2+\left({-4}\right)^2}=\sqrt{80}=4\sqrt{5}\approx8.944272

About this tool

The midpoint of a line segment is the point exactly halfway between its endpoints. In coordinate geometry it is found by averaging the coordinates, and it is used to bisect segments, find circle centers from a diameter and split a route or a board in half. This calculator works in two or three dimensions, also finds a missing endpoint and gives the distance between the points with the steps.

How it works

Choose whether you want the midpoint of two points or the other endpoint of a segment, and whether the points are on a plane (2D) or in space (3D). Enter the coordinates of point A and of point B, or of point A and the midpoint M.

The midpoint is the average of the endpoints, coordinate by coordinate: xM=x1+x22x_M = \frac{x_1 + x_2}{2}, and the same for y and z. Reversing this gives the missing endpoint, xB=2xM−xAx_B = 2x_M - x_A. The distance between the endpoints comes from the Pythagorean theorem and is shown exactly, for example 454\sqrt{5}, and as a decimal.

M=(x1+x22, y1+y22),d=(x2−x1)2+(y2−y1)2M=\left(\frac{x_1+x_2}{2},\ \frac{y_1+y_2}{2}\right),\qquad d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

Example

For A(−2, 3) and B(6, −1), the midpoint is M=(−2+62,3+(−1)2)=(2,1)M = \left(\frac{-2 + 6}{2}, \frac{3 + (-1)}{2}\right) = (2, 1). The distance is d=82+(−4)2=80=45≈8.944d = \sqrt{8^2 + (-4)^2} = \sqrt{80} = 4\sqrt{5} \approx 8.944.

If you know A(1, 2) and the midpoint M(4, 6), the other endpoint is B=(2⋅4−1,2⋅6−2)=(7,10)B = (2 \cdot 4 - 1, 2 \cdot 6 - 2) = (7, 10).

Assumptions and limits

Coordinates are treated as exact, so decimals and fractions give exact midpoints; very long inputs are limited to 30 digits. Distances use straight lines in flat (Euclidean) space; they are not valid for latitude and longitude on the Earth's surface, which needs a great-circle formula.

Frequently asked questions

What is the midpoint formula?

Average the x-coordinates and the y-coordinates: M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right). In 3D, average the z-coordinates too.

How do you find an endpoint from the midpoint?

Double the midpoint and subtract the known endpoint, coordinate by coordinate: xB=2xM−xAx_B = 2x_M - x_A and yB=2yM−yAy_B = 2y_M - y_A. Choose the endpoint mode to do this automatically.

How do you find the distance between two points?

Use d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}, which is the Pythagorean theorem applied to the horizontal and vertical differences. In 3D add (z2−z1)2(z_2 - z_1)^2 under the root.

Is the midpoint the same as the average?

Yes, each coordinate of the midpoint is the arithmetic mean of the matching coordinates of the two endpoints. On a number line, the midpoint of 3 and 11 is 7.

Can coordinates be negative or fractions?

Yes. Negative values, decimals and fractions such as 1/3 are all accepted, and the result stays exact: the midpoint of 0 and 1/3 is 1/6.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
modeFindone of: midpoint, endpointdefault midpoint
dimensionsDimensionsone of: 2, 3default 2
x1Point Afraction or decimal: 3/4, 1 1/2 or 0.75required
y1Point Afraction or decimal: 3/4, 1 1/2 or 0.75required
z1Point Afraction or decimal: 3/4, 1 1/2 or 0.75; used with dimensions = 3required
x2Point Bfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = midpointrequired
y2Point Bfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = midpointrequired
z2Point Bfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = midpoint; used with dimensions = 3required
midpoint_xMidpoint Mfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = endpointrequired
midpoint_yMidpoint Mfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = endpointrequired
midpoint_zMidpoint Mfraction or decimal: 3/4, 1 1/2 or 0.75; used with mode = endpoint; used with dimensions = 3required

Examples

  • ?x1=-4&y1=2&x2=6&y2=10
  • ?x1=1&y1=2&z1=3&x2=5&y2=-6&z2=7.5
  • ?x1=-2&y1=3&midpoint_x=2.5&midpoint_y=1

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="midpoint_calculator"]