Distance between two points

Choose 2D or 3D, enter both points, and get the distance, the midpoint and the differences along each axis.

Used only in 3D.
Used only in 3D.
Distance5
Midpoint
(2.5, 4)
Distance squared
25
Difference in x
3
Difference in y
4

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Pick 2D or 3D.
  2. Enter the coordinates of point 1 and point 2.
  3. Read the distance and midpoint. Copy either with the button next to it.

How it works

The distance is the square root of the sum of the squared differences along each axis. The midpoint averages each pair of coordinates. Results show up to 10 significant digits.

Worked example

Points (1, 2) and (4, 6): the differences are 3 and 4, so the distance is √(9 + 16) = 5 and the midpoint is (2.5, 4).

In 3D, (1, 2, 3) and (4, 6, 15): the differences are 3, 4 and 12, so the distance is √169 = 13 and the midpoint is (2.5, 4, 9).

Tips

  • The squared distance is useful when you only need to compare distances without roots.
  • If one endpoint and the midpoint are known, the other endpoint is 2 × midpoint − endpoint.

Frequently asked questions

What is the distance formula?

In 2D, d = √((x₂ − x₁)² + (y₂ − y₁)²). In 3D add (z₂ − z₁)² under the root. It is the Pythagorean theorem applied to the coordinate differences.

How is the midpoint found?

Average each coordinate: ((x₁ + x₂) / 2, (y₁ + y₂) / 2), and the same for z in 3D.

Can I use negative or decimal coordinates?

Yes. Differences are squared, so the order of the points and the signs do not change the distance.

Is this the distance between two places on Earth?

No. This is straight-line geometry on a flat plane or in space. For latitude and longitude use the coordinate distance calculator.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.