Geometry Calculators

Distance Formula Calculator

distance formula

Distance Formula Lesson

Lesson Contents

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:
d = 2D distance formula

The 3D distance formula is given as:
d = 3D distance formula

To hand calculate the distance between points, we simply plug the coordinates into their respective variable in formula. 

How the Calculator Works

The calculator on this page is written in the programming language JavaScript. When you click the “calculate” button, the distance formula function is run by your internet browser’s JavaScript engine which provides virtually instant results.

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.

Result :

Worksheet 1


Cheat sheet


Scroll to Top