Blog
Unit converters

Distance between points calculator

Enter the coordinates of point A (x1, y1) and point B (x2, y2), and the calculator computes the shortest distance between them on a plane using the Pythagorean theorem.

Your data never leaves this device

Point A

Point B

Result

Distance

This page has no server side at all. The table you paste is parsed by JavaScript inside your own browser, the chart is drawn on a canvas element on your machine, and the export file is assembled locally. Nothing is uploaded, stored or written to any log. You can disconnect from the network after the page has loaded and everything will still work — which is the simplest way to verify the claim yourself.

Facts and limits of this method

Formula d = √((x2 − x1)² + (y2 − y1)²)
3-4-5 example A(0,0), B(3,4) → distance = 5 (a classic right triangle)
Units The result is in the same units as the entered coordinates

When it misleads you

How it is calculated

The difference in x coordinates (x2 − x1) and y coordinates (y2 − y1) is computed.

Each difference is squared and the squares are added — this is the Pythagorean theorem for a right triangle whose legs equal these differences.

The square root of the sum of squares is taken, giving the straight-line (Euclidean) distance between the points.

The result is rounded to the chosen number of decimal places and updates instantly whenever any coordinate changes.

Questions and answers

Why does the example give exactly 5?

Because the points (0,0) and (3,4) form a classic right triangle with sides 3, 4 and 5 (a Pythagorean triple) — the hypotenuse (distance) equals √(3² + 4²) = √25 = 5.

Can I use negative coordinates?

Yes, the formula works the same in any quadrant — only the difference between the points' coordinates matters, not their sign.

Is this suitable for calculating distance between cities by latitude and longitude?

No, distances on the Earth's sphere (using geographic coordinates) need a different formula — the haversine formula, which accounts for the surface's curvature; this formula assumes a flat coordinate plane.

Is my data sent anywhere?

No, the whole calculation runs in your browser.

Related tools

All tools