Tools logoTools/
Math & Science/Distance Calculator

Distance Calculator

Distance between two points in 2D or 3D — Euclidean / Pythagorean.

Runs locally·Free, no signup·Updated May 6, 2026
Loading tool…
How it works

A walkthrough, end to end.

  1. 1

    Pick 2D or 3D mode.

  2. 2

    Enter the coordinates of both points.

  3. 3

    The calculator returns the Euclidean distance between them.

Reference

Euclidean distance

Generalization of the Pythagorean theorem. In 2D: d = √((x₂−x₁)² + (y₂−y₁)²). In 3D: add (z₂−z₁)² inside the square root. Foundation of basically all geometric distance calculations.

Use cases

What you can do with this.

Distance between coordinates

Point A (3, 4) to point B (7, 1) → d = √(16 + 9) = 5. Standard high-school geometry. The calculator handles arbitrary coordinates.

3D space distance

Useful in physics, 3D modeling, engineering. Particle at (1, 2, 3) and (4, 6, 8) → d = √(9 + 16 + 25) = √50 ≈ 7.07. The calculator handles 3D directly.

Distance traveled (vector magnitude)

If you walked 3 km east then 4 km north, your displacement is √(9+16) = 5 km, NOT 7 km of total distance. Distance traveled vs displacement — the calculator gives displacement.

Map / GPS distance (cartesian only)

For nearby points on small areas, treat lat/lon as cartesian and use Euclidean. For long distances on Earth, use Haversine formula instead (curvature matters). The calculator does flat geometry only.

Game / physics simulation

Detect when two objects are within range. Compare distance to a threshold to trigger collision, attack range, etc. Distance squared is faster (avoids sqrt) when only comparing.

Norm of a vector

Distance from origin (0, 0, ...) to a point is the vector's magnitude. Use point 1 = (0, 0, 0) to get a vector's norm/length directly.

Pythagorean special case

In 2D, distance formula IS the Pythagorean theorem with the legs being Δx and Δy. The two are mathematically identical.

Distance calculator 2026 — what's current

Modern game engines (Unity, Unreal) handle distance internally. The calculator is for design-time math, homework, and verification.

FAQ

Frequently asked.

  • Only for very short distances where Earth's curvature doesn't matter. For longer distances (city-to-city, etc.), use the Haversine formula — different calculator.

  • Sum of |Δx| + |Δy| (taxicab geometry, no diagonals). Different from Euclidean. Useful for grid-based pathfinding. Not what this calculator computes.

  • Distance is always positive (magnitude only). For vector with direction, you need separate Δx and Δy values — the calculator shows these in 2D.

  • No. Calculations run entirely in your browser.