Euclidean Distance Calculator — 2D & 3D
Find the straight-line distance between two points in 2D or 3D space by entering their coordinates — the formula generalises Pythagoras to any dimension.
Dimensions
Straight-line distance between the two points
- 1
Δx = x₂ − x₁
4 − 1 = 3 - 2
Δy = y₂ − y₁
6 − 2 = 4 - 3
d² = Δx² + Δy²
3² + 4² = 25 - 4
Distance d = √d²
√25 = 5
How does this calculator work?
Euclidean distance = √[(Δx)² + (Δy)²] in 2D, adding (Δz)² under the root for 3D. It is the straight-line ('as the crow flies') length derived directly from Pythagoras. Enter both points' coordinates to get the exact distance and axis-component breakdown instantly.
Formula
How this is calculated
The Euclidean distance is the length of the straight line between two points, generalising Pythagoras's theorem to any number of dimensions. For two 2D points the horizontal separation Δx and vertical separation Δy form the two legs of a right triangle; the hypotenuse — the distance — is d = √(Δx² + Δy²).
In 3D the same idea extends naturally: a third squared term Δz² is added under the square root, giving d = √(Δx² + Δy² + Δz²). The result is always non-negative and symmetric — d(A, B) = d(B, A) — and equals the shortest possible path between the two points in flat space.
The formula assumes Euclidean (flat) geometry and gives the 'as the crow flies' distance. It does not account for Earth curvature (use the haversine formula for geographic coordinates), obstacles, or graph-theoretic paths. It is the standard distance metric in machine learning feature spaces, clustering, and nearest-neighbour search.
Frequently asked questions
The length of the straight line connecting two points, computed as the square root of the sum of squared coordinate differences along each axis. In 2D it is the familiar Pythagorean distance; the formula extends term by term to any number of dimensions.
Euclidean distance is the straight-line ('as the crow flies') path. Manhattan distance sums the absolute differences along each axis (|Δx| + |Δy|), like walking on a city grid where diagonal moves are not allowed.
Yes. The formula extends to n dimensions as d = √(Σᵢ(xᵢ₂ − xᵢ₁)²). This is the standard distance measure in machine learning feature spaces, k-means clustering, and k-nearest-neighbours algorithms.
TG we-Calculate Editorial Team. (2026). Euclidean Distance Calculator — 2D & 3D [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/euclidean-distance-calculator
TG we-Calculate Editorial Team. "Euclidean Distance Calculator — 2D & 3D." TG we-Calculate. 2026. https://we-calculate.com/calculator/euclidean-distance-calculator.
TG we-Calculate Editorial Team, "Euclidean Distance Calculator — 2D & 3D," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/euclidean-distance-calculator
@misc{wecalculate_euclidean_distance_calculator, title = {Euclidean Distance Calculator — 2D & 3D}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/euclidean-distance-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
