Programmers and Teachers:
Distance Formula Calculator
Distance Formula Lesson
What is the Distance Formula?
The distance formula gives us a simple way of finding the distance between two points. It is an expansion of the Pythagorean theorem that allows us to use x and y coordinates instead of right triangle side lengths. For an in-depth look at the distance formula, see our lesson Distance Formula.
How to Hand Calculate Distance Between Points
There is a 2D distance formula and a 3D distance formula. We use the 2D formula when working in the x-y plane and the 3D distance formula when working in the x-y-z system.
The 2D distance formula is given as:
The 3D distance formula is given as:
To hand calculate the distance between points, we simply plug the coordinates into their respective variable in formula.
How the Calculator Works
The distance calculation code uses the 2D distance formula given above. Your x1 input is subtracted from your x2 input, then squared. The same operation is performed for your y inputs. Then, the squares of each difference are summed. The square root of that sum is taken, resulting in the distance between the points.
The raw distance output is rounded to the 4th decimal place before being displayed on this page. If any input errors are caught, an error notice will instead be displayed.