Calculate

Calculate

Updates as you type

Result

The formula

Use the Euclidean distance formula for two points (x1, y1) and (x2, y2).

d = √((x2−x1)^2 + (y2−y1)^2)

Worked example

  1. Points A(0, 0) and B(3, 4)
  2. Δx = 3 − 0 = 3, Δy = 4 − 0 = 4
  3. d = √(3^2 + 4^2) = √25 = 5

Result: Distance = 5

How the distance formula works

The straight-line length between two points on a flat plane is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps.

Link to the Pythagorean theorem

Treat Δx and Δy as the legs of a right triangle. The hypotenuse d is √(Δx² + Δy²). The distance formula is that relationship written for coordinates.

Signs and point order

Squaring the differences removes sign, so swapping point A and point B yields the same distance. Negative coordinates and decimals work without special handling.

Units

The result uses the same unit as your axes. If x and y are in meters, d is in meters. Mixing feet on one axis and meters on the other is invalid.

What this does not model

3D distance and great-circle (Earth surface) distance are out of scope. Map or GPS route length needs geodetic formulas, not a flat-plane Euclidean tool.

Interesting facts

Straight-line distance

This gives the shortest distance "as the crow flies" between two points on a flat coordinate plane.

Pythagorean link

The formula comes directly from the Pythagorean theorem, using Δx and Δy as triangle legs.

Works with negatives and decimals

Coordinates can be positive, negative, or decimal values.

Frequently asked questions

Yes. Negative x or y values work normally.

No. Swapping point A and B gives the same distance.

The distance is 0.

Yes, this version calculates distance on a 2D plane.

Squaring removes sign direction and follows the right-triangle relation behind Euclidean distance.

References

  1. Distance formula in the plane — Khan Academy Euclidean distance from the Pythagorean theorem.
  2. Pythagorean theorem — NIST Digital Library of Mathematical Functions Mathematical background for Δx/Δy distance calculations.

For educational and planning use only.

Last reviewed: 2026-08-15 — Reviewed by: Editorial Team

Embed this calculator

Add this calculator to your website with a free iframe widget.

Theme

The widget stretches to the width of its container and adjusts its height automatically.