Point A
Point B
Result
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
- The formula computes Euclidean (straight-line, "as the crow flies") distance on a flat plane — it isn't suitable for distances on a sphere (such as with geographic latitude/longitude coordinates), which need a separate haversine formula.
- Coordinates and the result are dimensionless from the calculation's point of view — the calculator doesn't convert units; interpreting the coordinates (meters, pixels, kilometers, etc.) is left to you.
- If both points coincide, the distance is correctly computed as 0.
- Rounding is applied only to the displayed result — internal calculations use the full precision of JavaScript floating-point numbers.
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.