Distance Formula Calculator
Calculate the straight-line distance between two points in 2D or 3D using the distance formula. Shows the differences and midpoint too.
Last reviewed by the Radiatus Cloud team
Find the distance between two points using the distance formula (Pythagorean theorem in coordinates).
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Measure the distance between two points
The distance formula gives the straight-line distance between two points in a coordinate plane. In two dimensions it is the square root of the sum of the squared differences in the x and y coordinates, which is a direct application of the Pythagorean theorem: the distance is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps. In three dimensions a z term is added under the same square root.
Enter the coordinates of both points and the calculator returns the distance, the individual coordinate differences, and the midpoint. Leaving the z fields blank keeps the calculation in two dimensions.
Where the distance formula is used
Navigation, mapping and games rely on distance between coordinates to measure travel, detect collisions and size layouts. Students use it throughout coordinate geometry, physics uses it for displacement, and data science uses the same idea as Euclidean distance between points in space.
Because the formula generalises the Pythagorean theorem, it works for any pair of real coordinates, including negatives and decimals. The midpoint is included because it is often needed alongside distance. All calculation runs locally in your browser.
Related tools
- Percentage Calculator — Calculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
- Statistical Calculator — Calculate mean, median, mode, standard deviation, and more.
- Probability Calculator — Calculate probabilities for single and combined events, including conditional probability and Bayes' theorem.
- Scientific Calculator — Perform advanced mathematical operations including trig, log, and exponents.
Frequently Asked Questions
What is the distance formula?
The distance equals the square root of the sum of the squared differences of the coordinates. In 2D that is the square root of delta x squared plus delta y squared.
How do I do a 3D calculation?
Fill in the z coordinate for both points. The tool then includes the z difference and switches to the three-dimensional formula automatically.
Is this related to the Pythagorean theorem?
Yes. The distance is the hypotenuse of a right triangle whose legs are the coordinate differences, so the formula is the Pythagorean theorem in coordinates.
Does it work with negative coordinates?
Yes. Any real coordinates are accepted, including negatives and decimals, because distance depends only on the differences.
Why show the midpoint?
The midpoint, the average of the two points coordinate by coordinate, is often needed alongside distance in geometry problems, so it is included for convenience.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Enter the coordinates of two points. Leave z blank for 2D.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Percentage Calculator
MathCalculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
Statistical Calculator
MathCalculate mean, median, mode, standard deviation, and more.
Probability Calculator
MathCalculate probabilities for single and combined events, including conditional probability and Bayes' theorem.