Distance Calculator
Calculate the distance between two points in 2D or 3D space, or great-circle distance between two latitude/longitude coordinates on Earth.
a² + b² = c²
How to use the Distance Calculator
- Enter your inputs into the Distance Calculator above.
- Results update instantly as you type — no submit button needed.
- Adjust any value to see how the result changes in real time.
The distance formulas
2D: d = √((x₂−x₁)² + (y₂−y₁)²) · · · 3D: add (z₂−z₁)² · · · Great-circle: Haversine formula
For points on a plane, use Pythagorean distance. For points on a sphere (Earth), use the Haversine formula with latitude and longitude. Manhattan distance (|Δx| + |Δy|) is sometimes used for grid-based problems.
Worked example
Distance from (1, 2) to (4, 6): √((4−1)² + (6−2)²) = √(9 + 16) = √25 = 5. From New York (40.71°N, 74.00°W) to Los Angeles (34.05°N, 118.24°W) by Haversine: about 3,940 km / 2,450 miles.
Frequently asked questions
When should I use Haversine vs. Pythagorean?
Haversine for points on Earth's surface beyond a few km — accounts for curvature. Pythagorean for points on a flat plane or for very short distances where the curvature error is negligible.
Is great-circle distance the same as flight distance?
Great-circle is the shortest path between two points on a sphere — what airlines minimize. Actual flight distance is usually 5–10% longer due to airspace routing.
What about driving distance?
Always longer than straight-line distance — roads don't go in straight lines. Use a maps service (Google Maps, OpenStreetMap) for road distance.