Advanced maths

Distance and midpoint calculator

Find Euclidean distance and midpoint between two points in two or three Cartesian dimensions.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Try it, understand it

Explore the result

Change dimension explicitly rather than silently omitting a third coordinate.

Worked example comparison
ExampleOutputWhat to notice
A two-dimensional 3–4–5 segmentStraight-line distance5 coordinate unitsFrom (0,0) to (3,4), distance is five.
A three-dimensional segmentStraight-line distance13 coordinate unitsAdding a z difference of twelve changes the distance to thirteen.
Coincident endpointsStraight-line distance0 coordinate unitsEqual coordinates have zero distance and their own shared midpoint.

Check your understanding

Is a 3D segment’s flat drawing its full length?

Not generally. A projection can omit the z contribution.

Are latitude and longitude ordinary length coordinates?

No. They need a geographic model.

Behind the numbers

How this calculation works

Subtract matching coordinates, square the differences and take the square root of their sum. Average each coordinate pair to obtain the midpoint. Include the z coordinate in three-dimensional mode; do not confuse a two-dimensional drawing with a three-dimensional distance.

THE FORMULADistance = √[Σ(Bᵢ−Aᵢ)²]; midpoint coordinate i = (Aᵢ+Bᵢ)/2

A worked example

From (0, 0) to (3, 4), the distance is 5 and the midpoint is (1.5, 2).

Good to know

Flat Cartesian coordinates in matching units. Supports two or three dimensions, including coincident points. This does not calculate a road route, spherical distance, Earth-surface midpoint or projection between coordinate reference systems. Numeric distances and midpoint displays are rounded.

A third coordinate contributes another squared difference

In a plane, distance uses the x and y differences. In three dimensions it also includes the z difference. Points (0,0,0) and (3,4,12) are thirteen units apart because √(9+16+144)=13. Ignoring z would report five and answer a different two-dimensional question.

A midpoint averages each coordinate pair independently. For the same points it is (1.5,2,6). The coordinates of a midpoint are not required to be integers even when both endpoints have integer coordinates. Coincident endpoints have zero distance and their shared position is also the midpoint.

A map coordinate is not automatically a flat distance input

These equations assume perpendicular Cartesian axes with matching units. Latitude and longitude are angles on a reference surface, not ordinary metre coordinates. The WGS84 UTM converter handles a specified geographic-to-grid transformation, with its own zone and reference-system assumptions.

The two-dimensional graph shows the actual included x/y geometry. Three-dimensional mode reports a coordinate table and the full three-axis calculation rather than presenting a flat outline as though it were the physical 3D segment. Straight-line distance is also not the same as travel distance along a road or terrain.

A few questions, answered

Does 3D mode require z for both points?

Yes. Both endpoints need a z coordinate in the same linear unit as x and y.

Is the midpoint half of the distance value?

No. It is a position whose coordinates are the averages of the endpoint coordinates.

Can this calculate a geographic midpoint from latitude and longitude?

No. Those angular coordinates need a suitable geographic model.

Find your calculator

Start typing to explore the library.