Skip to content
K Knidox Search…
Geometry · Geometry

Distance & Midpoint

Find the distance and midpoint between two points.

Distance
5

Between (1, 2) and (4, 6)

Midpoint
(2.5, 4)

The average of the two x-values and the two y-values.

The distance between two points is √((x₂ − x₁)² + (y₂ − y₁)²) and the midpoint is the average of their coordinates. For (1, 2) and (4, 6): distance = √(3² + 4²) = √(9 + 16) = √25 = 5, and the midpoint is (2.5, 4).

What distance and midpoint measure

Given two points in the plane, the distance is the straight-line length of the segment joining them, and the midpoint is the point exactly halfway along that segment. The distance comes directly from the Pythagorean theorem: the horizontal gap (x₂ − x₁) and the vertical gap (y₂ − y₁) are the two legs of a right triangle, and the distance is its hypotenuse. The midpoint is simply the average of the x-coordinates paired with the average of the y-coordinates.

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

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

Worked example

Distance and midpoint between (1, 2) and (4, 6):

  1. 1
    Find the horizontal and vertical differences. x₂ − x₁ = 4 − 1 = 3 and y₂ − y₁ = 6 − 2 = 4.
  2. 2
    Square each difference. 3² = 9 and 4² = 16.
  3. 3
    Add the squares. 9 + 16 = 25.
  4. 4
    Take the square root. √25 = 5, so the distance is 5.
  5. 5
    Average the coordinates for the midpoint. ((1 + 4)/2, (2 + 6)/2) = (2.5, 4).

Distance and midpoint, side by side

Two points P₁ = (x₁, y₁) and P₂ = (x₂, y₂); the right column shows the (1, 2)–(4, 6) example.

QuantityFormulaExample
Horizontal gapx₂ − x₁4 − 1 = 3
Vertical gapy₂ − y₁6 − 2 = 4
Distance√((x₂ − x₁)² + (y₂ − y₁)²)√(9 + 16) = √25 = 5
Midpoint((x₁ + x₂)/2, (y₁ + y₂)/2)(2.5, 4)

Why it works, and how far it extends

It is the Pythagorean theorem. The two coordinate differences form the legs of a right triangle, and the distance is the hypotenuse — so √((x₂ − x₁)² + (y₂ − y₁)²) is just a² + b² = c² rearranged.

The midpoint is an average. Halfway between two values is their mean, so you average the x-coordinates and the y-coordinates independently. This works for any two points, including negative coordinates.

It generalizes. The same idea extends to three dimensions by adding a (z₂ − z₁)² term under the root, and to the origin by setting one point to (0, 0).

Why is the distance formula the Pythagorean theorem?
The horizontal difference x₂ − x₁ and the vertical difference y₂ − y₁ are the two legs of a right triangle, and the distance between the points is its hypotenuse. So √((x₂ − x₁)² + (y₂ − y₁)²) is exactly a² + b² = c² solved for c.
Does the order of the two points matter?
No. Each difference is squared, and (x₂ − x₁)² equals (x₁ − x₂)², so swapping the points gives the same distance. The midpoint is also unchanged, since addition is order-independent.
How do I find the distance from the origin?
Set the second point to (0, 0). Then d = √(x₁² + y₁²). For example, the distance from (3, 4) to the origin is √(9 + 16) = √25 = 5.
Can I use this for points in 3D?
The same logic extends to three dimensions: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²), and the midpoint averages all three coordinates. This 2D tool covers points in the plane.
What does the midpoint actually represent?
It is the point lying exactly halfway along the segment between the two points — equidistant from both. You get it by averaging the x-coordinates and averaging the y-coordinates separately.
Why might the distance not be a whole number?
A square root is only a whole number when the sum of squares is a perfect square, like √25 = 5. Most point pairs give an irrational result, such as √20 ≈ 4.4721, which the tool rounds to four decimals.