Distance Calculator: 2D, 3D & GPS Distance Guide (2026)
Calculate distance between two points with the Euclidean formula. Full guide for 2D coordinates, 3D space, and GPS lat/long with Haversine formula.
Distance Calculator — Direct Answer
2D distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). For 3D: add (z₂ − z₁)². For GPS coordinates: use the Haversine formula for great-circle distance. Distance between (2, 3) and (8, 11) = 10 units. Between (0,0,0) and (2,3,6) = 7 units.
→ Calculate distance with our free distance calculator
How to Calculate Distance
Three formulas depending on your data.
2D distance formula
d = √((x₂ − x₁)² + (y₂ − y₁)²)
Example: (2, 3) to (8, 11)
- Δx = 6, Δx² = 36
- Δy = 8, Δy² = 64
- d = √100 = 10 units
3D distance formula
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Example: (0, 0, 0) to (2, 3, 6)
- Δx² = 4, Δy² = 9, Δz² = 36
- d = √49 = 7 units
Haversine formula (GPS)
a = sin²(Δφ/2) + cos φ₁ × cos φ₂ × sin²(Δλ/2)
c = 2 × atan2(√a, √(1−a))
d = R × c
Where:
- φ = latitude, λ = longitude (in radians)
- R = Earth's radius (3,959 mi or 6,371 km)
How to convert GPS to distance
Example: New York (40.7128°, −74.0060°) to Los Angeles (34.0522°, −118.2437°)
- Δφ = −6.6606° = −0.1163 rad
- Δλ = −44.2377° = −0.7720 rad
- Haversine result: ~2,451 miles (great-circle)
Distance Chart
Common 2D distances
| Points | Δx | Δy | Distance |
|---|---|---|---|
| (0,0) to (3,4) | 3 | 4 | 5.00 |
| (0,0) to (5,12) | 5 | 12 | 13.00 |
| (1,2) to (4,6) | 3 | 4 | 5.00 |
| (0,0) to (1,1) | 1 | 1 | 1.41 |
| (0,0) to (6,8) | 6 | 8 | 10.00 |
| (−2,3) to (4,−5) | 6 | 8 | 10.00 |
3D distances
| Points | Distance |
|---|---|
| (0,0,0) to (1,1,1) | 1.73 |
| (0,0,0) to (2,3,6) | 7.00 |
| (1,2,3) to (4,6,3) | 5.00 |
| (0,0,0) to (4,4,4) | 6.93 |
GPS city distances (great-circle)
| From | To | Distance |
|---|---|---|
| NY to LA | 2,451 mi | |
| LA to Chicago | 1,745 mi | |
| NY to London | 3,459 mi | |
| LA to Tokyo | 5,475 mi | |
| Chicago to Miami | 1,188 mi |
Common Distance Calculation Mistakes
Mistake 1: Forgetting to square before adding
Distance formula requires squaring deltas first, then square-rooting.
Fix: d² = Δx² + Δy². Then d = √.
Mistake 2: Using Manhattan distance for Euclidean
Manhattan distance (|Δx| + |Δy|) only applies to grid movement.
Fix: For straight-line distance, use Pythagorean/Euclidean formula.
Mistake 3: Confusing miles with nautical miles
Nautical mile = 1.15078 statute miles. Used in aviation and marine navigation.
Fix: Match the unit to your context. Cars use statute miles. Boats use nautical.
Distance Types Compared
Euclidean distance
- Definition: Straight-line distance
- Formula: √(Δx² + Δy²)
- Use: Math, physics, geometry
Manhattan distance
- Definition: Grid-based (sum of axis distances)
- Formula: |Δx| + |Δy|
- Use: City grid navigation
Haversine distance
- Definition: Great-circle distance on a sphere
- Formula: Uses lat/long
- Use: GPS, aviation, marine
Driving distance
- Definition: Actual road distance
- Formula: Varies with route
- Use: Trip planning (Google Maps, Waze)
Distance Calculator FAQ
How do I calculate distance between two points?
d = √((x₂ − x₁)² + (y₂ − y₁)²) for 2D. Add (z₂ − z₁)² for 3D.
What is the distance formula?
Same as Pythagorean theorem applied to coordinate deltas.
How do I calculate GPS distance?
Use the Haversine formula with latitude/longitude in radians. Result is great-circle distance.
What's the difference between Euclidean and Manhattan distance?
Euclidean: straight line. Manhattan: grid path (only horizontal/vertical).
How far is it from New York to Los Angeles?
~2,451 miles great-circle distance. Driving distance is ~2,790 miles.
Next Steps for Distance Math
- Distance Formula Calculator — Any two points
- Triangle Calculator — Triangle sides
- Math Calculator — All math tools
- Distance Formula Guide — Full guide
- Pythagorean Guide — Right triangles
Last updated October 2026. GPS distances assume Earth is a sphere — actual distance differs slightly due to ellipsoid shape.
