Education & Research Tools

Midpoint Calculator

Find the midpoint between two points in 2D or 3D, the distance between them, the slope and the line equation, or the halfway value between two numbers, with the formula and a small plotted graph.

  • Midpoint and distance
  • Slope and line equation
  • Plotted points
Runs in your browser

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics.

Midpoint workspace

1 What do you have?

Try it:
Mode

2 The two points

Whole numbers, decimals or fractions such as 3/4 are all fine.

Point A
Point B
Divide the segment in a ratio (section formula)

The point that splits A to B in the ratio m : n, measured from A. 1 : 1 is the midpoint.

3 Result

Enter both points (or both numbers) and the midpoint, distance and slope appear here with the working.

What the Midpoint Calculator does

This midpoint calculator finds the point exactly halfway between two points in 2D or 3D, together with the distance between them, the slope, the equation of the line through them and its perpendicular bisector. It can also work backwards to the missing endpoint when you know one end and the middle, and find the value halfway between two ordinary numbers.

The answers are exact. Coordinates are held as fractions, so the midpoint of (1, 2) and (4, 7) is shown as (5/2, 9/2) rather than a rounded decimal, and a distance such as the square root of 50 is written as 5 times the square root of 2 alongside its decimal value of about 7.0711. Each result comes with the working written out line by line - the form a teacher expects to see - and a small graph of the points drawn to the same scale on both axes. Nothing you type leaves your browser.

How to use it

  1. Pick what you have: two points on a flat graph (2D), two points in space (3D), one endpoint and the midpoint, or just two numbers.
  2. Type the coordinates. Whole numbers, negative numbers, decimals and fractions such as -3/4 are all accepted.
  3. Read the answer at the top, then the tiles underneath: distance, slope, the line through both points in y = mx + b and standard form, the perpendicular bisector and the angle of the line.
  4. Check the working list. It shows each formula with your numbers substituted, so you can copy the method into homework or spot where your own answer went wrong.
  5. Open the section-formula panel if you need the point that divides the segment in a ratio such as 1 : 2 rather than exactly in half.

Reading the results

The midpoint is the average of the two points, coordinate by coordinate. It always lies on the segment between them, at the same distance from each end - half the length of the segment.

When the distance is a whole number or a fraction it is shown exactly. When it is irrational - as most distances are - it is shown as a simplified square root (for example 2 times the square root of 13) and as a decimal to four places. Use the square-root form in algebra and the decimal for measurement.

A slope of 0 means the line is horizontal. When the two x coordinates are equal the line is vertical, its slope is undefined rather than infinite, and its equation is of the form x = c with no y term.

The perpendicular bisector is the line through the midpoint at right angles to the segment. Every point on it is the same distance from A as from B, which is why it is used to find the centre of a circle through three points.

Worked example: the points (1, 2) and (7, 10)

Midpoint: average each coordinate. x = (1 + 7) / 2 = 4 and y = (2 + 10) / 2 = 6, so M = (4, 6).

Distance: the horizontal change is 7 - 1 = 6 and the vertical change is 10 - 2 = 8. The distance is the square root of 6 squared plus 8 squared, the square root of 36 + 64 = 100, which is exactly 10 - a 6-8-10 right triangle. Each half of the segment is therefore 5 long.

Slope: rise over run is 8 / 6 = 4/3. The intercept is b = 2 - (4/3)(1) = 2/3, so the line is y = (4/3)x + 2/3, or 4x - 3y = -2 in standard form; substituting (7, 10) gives 28 - 30 = -2, which checks.

Perpendicular bisector: the slope is the negative reciprocal, -3/4, and it passes through (4, 6), so y = -(3/4)x + 6 + 3, that is y = -(3/4)x + 9.

Formulas and scoring rules

Midpoint (2D)
M = ((x1 + x2) / 2, (y1 + y2) / 2)
Midpoint (3D)
M = ((x1 + x2) / 2, (y1 + y2) / 2, (z1 + z2) / 2)
Distance
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 [+ (z2 - z1)^2])Pythagoras' theorem. The square root is simplified exactly and also shown to 4 decimal places, rounded half away from zero.
Slope
m = (y2 - y1) / (x2 - x1)Undefined when x1 = x2 (a vertical line).
Line through two points
y = m x + b, with b = y1 - m x1; standard form A x + B y = C with whole-number A, B, C
Missing endpoint
x2 = 2 xm - x1, y2 = 2 ym - y1Rearranged from the midpoint formula.
Section formula
P = (n A + m B) / (m + n)The point dividing AB internally in the ratio m : n, counted from A.
Perpendicular bisector
slope -1 / m through MHorizontal if AB is vertical, vertical if AB is horizontal.

Midpoints outside the classroom

The same averaging works for any two values on a straight scale: the middle of a price range, the centre of a beam between two supports, the halfway mark between two kilometre posts, or the midpoint of a class interval in a frequency table. The Two numbers mode is for exactly that.

It does not work for places on a map. Latitude and longitude are angles on a curved Earth, so the geographic halfway point between two cities is found along a great circle, not by averaging the coordinates; for that, use a latitude and longitude distance tool instead.

Limitations: what the result does not prove

  • It works in flat (Euclidean) space with straight lines. It is not a map tool: averaging latitudes and longitudes gives the wrong halfway point except over short distances.
  • Slope, line equations and the perpendicular bisector are given only for 2D points, because a line in 3D has no single slope and needs a vector or parametric equation instead.
  • Coordinates must be real numbers. Symbols such as a, b or square roots cannot be typed; for a symbolic answer, apply the formulas shown here by hand.
  • The graph is a sketch to confirm the picture, drawn to equal scale; read exact values from the numbers, not from the plot.

Privacy: where your data goes

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.

Standards and sources

Frequently asked questions

What is the formula for the midpoint of a line segment?

Add the x coordinates and halve them, then do the same for the y coordinates: M = ((x1 + x2) / 2, (y1 + y2) / 2). In 3D you do the same for z. The midpoint is simply the average of the two endpoints.

How do I find an endpoint if I know the midpoint and the other endpoint?

Double the midpoint and subtract the known endpoint: x2 = 2 xm - x1 and y2 = 2 ym - y1. For a midpoint (4, 1) and endpoint (2, 5) the other end is (8 - 2, 2 - 5) = (6, -3). Choose the Endpoint mode and the calculator does it with the check.

How do you find the number halfway between two numbers?

Add them and divide by 2. Halfway between 15 and 40 is 55 / 2 = 27.5, which is 12.5 from each. It works for negative numbers too: halfway between -8 and 3 is -2.5.

Is the midpoint the same as the average?

Yes - the midpoint is the mean of the two endpoints, taken separately for each coordinate. For more than two points the same averaging gives the centroid, which is the balance point of the shape they form rather than a midpoint.

Why is the slope undefined for a vertical line?

Slope is the change in y divided by the change in x. On a vertical line x does not change, so the division is by zero and there is no number that describes it. Its equation is written as x = c instead of y = mx + b.

How is the distance between two points related to Pythagoras?

The horizontal and vertical differences between the points are the two shorter sides of a right triangle, and the segment joining them is the hypotenuse. The distance formula is Pythagoras' theorem written in coordinates, with a third squared term added in 3D.

What does the perpendicular bisector tell me?

It is the set of all points equally far from A and B. It passes through the midpoint at right angles to AB, so its slope is the negative reciprocal of AB's slope. Where the bisectors of two chords meet is the centre of the circle through their endpoints.

Last reviewed by the A2Z.Tools team against the sources listed above.

Rate this tool

Was this tool useful? Your feedback helps us improve it.

No ratings yet — be the first to rate this tool.
Your rating (required)
0 / 2000

Please do not include passwords, payment details or other sensitive information.

Your feedback is sent privately to the A2Z.Tools team and will not be posted publicly.

Advertisement