2D Distance Calculator
Enter two points (x₁,y₁) and (x₂,y₂) to find the straight-line distance on a plane — for map measurement, geometry and coordinate planning.
Input Data
Results
At a glance:The 2D distance between two points is the straight-line distance on a rectangular coordinate plane. Given A(x₁,y₁) and B(x₂,y₂), the horizontal and vertical differences are Δx = x₂−x₁ and Δy = y₂−y₁; by Pythagoras the distance is d = √(Δx² + Δy²). This is the standard Euclidean distance in two dimensions and the basis for 3D distance and Manhattan distance.
Formula
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
where Δx = x₂ − x₁, Δy = y₂ − y₁.
e.g. A(3,2), B(6,6) → d = √(3² + 4²) = √25 = 5
$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$How to Use
- Enter the first point (x₁, y₁).
- Enter the second point (x₂, y₂).
- The calculator shows the straight-line distance.
- Distance is 0 when the points coincide; inputs may be negative.
Common point-pair distances
| Point 1 | Point 2 | Distance |
|---|---|---|
| (0, 0) | (3, 4) | 5 |
| (1, 1) | (4, 5) | 5 |
| (-2, 3) | (4, -5) | 10 |
| (0, 0) | (5, 12) | 13 |
Computed as d = √(Δx²+Δy²). If Δx²+Δy² is a perfect square, the distance is an integer.
Case Studies
Geometry and maps
From (0,0) to (3,4): d = √(9+16) = 5 — the classic 3-4-5 right triangle.
Two map locations (Δx,Δy) = (4 km, 3 km) → straight-line distance 5 km.
Park coordinates (2,1) and (8,9) → d = √(36+64) ≈ 10.
Programming and graphics
Computer graphics computes the centre distance between two objects to detect collisions.
GPS positioning: approximate planar distance from latitude/longitude differences (small-area approximation).
Game development uses the distance formula for unit selection (range check).
FAQ
How is this related to Pythagoras' theorem?
The two-point distance formula is the coordinate version of Pythagoras: Δx and Δy are the legs of a right triangle and d is the hypotenuse, so d² = Δx² + Δy².
Does it work with negative or cross-quadrant coordinates?
Yes. The differences (x₂−x₁) and (y₂−y₁) are squared and always non-negative, so the formula holds for any quadrant and any negative coordinate.
What is 3D distance?
3D distance adds the z direction: d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²], a natural extension of the 2D formula.
How is Euclidean distance different from Manhattan distance?
Euclidean distance is the straight-line distance; Manhattan distance is the total walked distance along horizontal and vertical streets |Δx|+|Δy|, like a city grid — usually larger than or equal to the straight-line distance.
Can distance be negative?
No. Distance is a length and is always non-negative; it is 0 only when the two points are identical.
Related Tools
References
Content review: Calculatorism Science Team. Results are for reference only; please refer to the relevant authorities for the official figures.