Distance Between Two Points Calculator
This Distance Between Two Points Calculator finds the straight-line distance between two points on a coordinate plane, and shows the working line by line. The horizontal gap and the vertical gap between the points are the two shorter sides of a right triangle, so each difference is squared, the squares are added, and the square root of that total is the distance. Following the same pattern every time is what makes the distance formula easy to check and repeat.
Enter the coordinates for \((x_{1}, y_{1})\) and \((x_{2}, y_{2})\).
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the two pairs of coordinates into the formula.
- Work out the distance.
Formula: Distance Formula
This formula gives the straight-line distance d between two points. Subtract the x values and the y values, square both, add, then take the square root.
Useful Tips to Remember
The distance formula is \(d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\), which is Pythagoras' theorem on a grid. Subtract the coordinates in the same order for both \(x\) and \(y\). Squaring makes any negative differences positive, so the order of the points does not change the answer. Add the squares before taking the square root, and remember that a distance can never be negative.
Required knowledge
- How to subtract numbers, including negatives, covered in the Subtraction of Small Numbers Calculator.
- How to take a square root like √52, covered in the Simplifying Radicals Calculator.
- Where the formula comes from, covered in the Pythagoras Theorem Calculator.
Where Is the Distance Between Two Points Used?
The distance formula finds the straight-line length between two points from their coordinates, using Pythagoras' theorem on the horizontal and vertical gaps. It is the maths behind measuring distances on maps and in apps, such as how far a delivery is or which shop is closest. Video games use it to check when characters collide, and robots and drones use it to plan routes. In data science, the same formula measures how similar two data points are, which powers recommendation systems and machine learning.
- Measuring straight-line distances on maps and grid plans
- Finding the nearest shop, station or driver in apps
- Detecting collisions between objects in video games
- Planning paths for robots and drones
- Comparing data points in machine learning
Distance Between Two Points Practice Problems
Example 1 finds the distance from \((2, 3)\) to \((14, 11)\), and Example 2 uses \((-5, 2)\) and \((15, 9)\) with a negative coordinate. Try the distance formula yourself, then compare. For two more free worked examples, check out the Distance Between Two Points Notes.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the two pairs of coordinates into the formula.
- Work out the distance.
Formula
Formula: Distance Formula
This formula gives the straight-line distance d between two points. Subtract the x values and the y values, square both, add, then take the square root.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the distance between the points \((2, 3)\) and \((14, 11)\).
Step 2
Step 2 - Write the formula.
In this problem: The horizontal gap and the vertical gap between the points are the two shorter sides of a right triangle, and the straight line joining the points is its hypotenuse.
Step 3
Step 3 - Substitute the two pairs of coordinates into the formula.
In this problem: Replacing each coordinate in \(d = \sqrt{(x_{2} - x_{1})^{2} + (y_{2} - y_{1})^{2}}\) gives \(d = \sqrt{\left(14 - 2\right)^{2} + \left(11 - 3\right)^{2}}\).
Step 4
Step 4 - Work out the distance.
In this problem: Subtracting the x-coordinates gives the horizontal difference: \(14 - 2 = 12\). Subtracting the y-coordinates gives the vertical difference: \(11 - 3 = 8\). Squaring the horizontal difference gives \(12^{2} = 144\). Squaring the vertical difference gives \(8^{2} = 64\). Adding the two squares gives \(144 + 64 = 208\). Taking the square root undoes the squaring and gives \(\sqrt{208} \approx 14.42\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Substitute the two pairs of coordinates into the formula.
- Work out the distance.
Formula
Formula: Distance Formula
This formula gives the straight-line distance d between two points. Subtract the x values and the y values, square both, add, then take the square root.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the distance between the points \((-5, 2)\) and \((15, 9)\).
Step 2
Step 2 - Write the formula.
In this problem: The horizontal gap and the vertical gap between the points are the two shorter sides of a right triangle, and the straight line joining the points is its hypotenuse.
Step 3
Step 3 - Substitute the two pairs of coordinates into the formula.
In this problem: Replacing each coordinate in \(d = \sqrt{(x_{2} - x_{1})^{2} + (y_{2} - y_{1})^{2}}\) gives \(d = \sqrt{\left(15 - \left(-5\right)\right)^{2} + \left(9 - 2\right)^{2}}\).
Step 4
Step 4 - Work out the distance.
In this problem: Subtracting the x-coordinates gives the horizontal difference: \(15 - \left(-5\right) = 20\). Subtracting the y-coordinates gives the vertical difference: \(9 - 2 = 7\). Squaring the horizontal difference gives \(20^{2} = 400\). Squaring the vertical difference gives \(7^{2} = 49\). Adding the two squares gives \(400 + 49 = 449\). Taking the square root undoes the squaring and gives \(\sqrt{449} \approx 21.19\).
Final Answer
Notes and Practice Mode
Want to understand the method more deeply? The Distance Between Two Points Notes go through the same pattern with extra worked examples and fuller explanations of the ideas behind each step, so you can see why every step works and not just what to do. When you are ready to test yourself, Distance Between Two Points Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode is available on the Plus and Pro plans.
Login and upgrade to Plus to unlock the full step solution.
Example Problems
Click one to load it into the box and solve it.