Distance Formula Calculator
Calculate the distance between two points in 2D or 3D, plus the squared and Manhattan distances.
Your inputs
Results
Distance
5
- Distance squared
- 25
- Manhattan (grid) distance
- 7
✓Exact calculation — rounded only for display
What this calculator does
The distance formula is Pythagoras’ theorem applied to coordinate differences.
Formula and method
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Worked example
Calculated by this tool with its default inputs:
Inputs
- Dimensions: 2D (x, y)
- x₁: 1
- y₁: 2
- x₂: 4
- y₂: 6
Results
- Distance: 5
- Distance squared: 25
- Manhattan (grid) distance: 7
How to read the results
Manhattan distance is the grid distance along axes.
Assumptions and limitations
- Computed with a numerically stable hypot function.
Questions
Does it work for latitude and longitude?
No — geographic distance needs a spherical formula.
Methodology and verification
- Result type
- Exact mathematical calculation (rounded only for display)
- Formula version
- 1.0
- Automated verification
- 3 reference and validation test cases, checked against independently computed values. The site cannot be built if any of them fail.
- Editorial review
- Awaiting human editorial review. The explanation was drafted with AI assistance; the formula and examples are verified by the automated tests above.
Privacy
Everything you enter is calculated in this browser and is not sent to Numerith or anyone else. Inputs are added to a share link only if you choose to include them. Privacy policy