Distance Between Two Points

Straight-line distance and midpoint between two points on the plane.

What does this calculator do?

The straight-line (Euclidean) distance between two points in the plane, computed with the distance formula — which is the Pythagorean theorem applied to the horizontal and vertical differences. The midpoint (the coordinate-wise average) comes free with the same inputs. Coordinates may be negative or decimal, and the distance comes out in the same unit as the coordinates.

Formula

A right triangle with legs Δx and Δy:

d = √((x₂ − x₁)² + (y₂ − y₁)²)
midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Coordinate plane diagramTwo points (x1, y1) and (x2, y2) on a coordinate plane joined by the distance d.(x₁, y₁)(x₂, y₂)d
Diagram not to scale.

How to use it

Enter the coordinates of both points. Order does not affect the distance (the differences are squared); it only flips the sign of Δx and Δy shown in the steps.

Worked example

From (1, 2) to (4, 6): Δx = 3, Δy = 4, d = √(9 + 16) = 5. The midpoint is (2.5, 4).

Formula version1.0.0
Formulad = √((x₂ − x₁)² + (y₂ − y₁)²) midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Precision4 decimals

Frequently asked questions

Does the order of the points matter?

Not for the distance or the midpoint. Swapping the points negates Δx and Δy, but squaring removes the sign, and the average is symmetric.

Can coordinates be negative?

Yes — the formula handles any real coordinates. From (−2, −3) to (1, 1) the distance is √(9 + 16) = 5.

Does this work on a map?

Only for flat, projected coordinates in the same unit. Latitude/longitude pairs live on a sphere and need great-circle formulas instead — this tool is for plane geometry.

Sources

Related calculators

Last updated: 2026-07-31 · v1.0.0 · Report an error