Distance Formula Calculator
Calculate the straight-line distance between two points in 2D or 3D space using the Euclidean distance formula. Also shows the midpoint.
Point 1
Point 2
Enter coordinates for both points to calculate the distance.
Advertisement
Euclidean Distance Formula
The distance formula is derived from the Pythagorean theorem. Square the difference in each coordinate, sum them, then take the square root.
2D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Midpoint 2D: ((x₁+x₂)/2, (y₁+y₂)/2)
Euclidean vs Other Distance Metrics
Euclidean distance is the most intuitive notion of distance — the length of the shortest path between two points through open space. It corresponds to what you would measure with a ruler. However, there are other distance metrics used in different contexts.
Manhattan distance (also called taxicab or L1 distance) sums the absolute differences of coordinates without squaring them. It represents the distance travelled on a grid where you can only move horizontally or vertically, like navigating a city block. It is used in some machine learning algorithms and urban planning calculations.
For geographic coordinates on Earth's curved surface, neither Euclidean nor Manhattan distance is appropriate for long distances. The Haversine formula calculates great-circle distance on a sphere, giving the shortest path across the globe's surface. GPS and aviation systems use this for navigation over large distances.