Distance Between Two Points: Formula, Methods, and Examples
The distance between two points on a coordinate plane is the exact length of the straight line segment joining them. To find this length, identify the horizontal and vertical changes between the points and apply the Pythagorean theorem.
What is distance between two points?
The distance between any two locations is a measure of the shortest path connecting them. On a flat surface, this path is always a straight line segment.
In coordinate geometry, every point is identified by an ordered pair . The distance is the mathematical length of the segment connecting these two sets of coordinates. Because length measures a physical magnitude, distance must always be a positive value or zero.
The shortest distance between two points is the straight line connecting them.

Build a right triangle from coordinate changes
To calculate the length between two angled points, separate the path into horizontal and vertical movements. This creates a right-angled triangle where the original segment acts as the hypotenuse.
Find the horizontal change by subtracting the -coordinates. Find the vertical change by subtracting the -coordinates. The intersection of these two paths always forms a right angle.

Derive and use the distance formula
Because the horizontal and vertical paths form a right triangle, the Pythagorean theorem applies. The theorem states that the square of the hypotenuse equals the sum of the squares of the other two sides.
Let the points be and . The horizontal side has length and the vertical side has length .
Substitute these expressions into the Pythagorean theorem:
Take the square root of both sides to isolate the distance . This yields the final coordinate distance formula.
Coordinate distance formula
Steps to use the formula:
- Assign to the first coordinate pair and to the second pair.
- Subtract the -coordinates and apply an exponent of two to the result.
- Subtract the -coordinates and apply an exponent of two to the result.
- Add the two squared values together.
- Take the principal square root of the sum.
Handle horizontal and vertical segments
When two points share the same -coordinate or the same -coordinate, the segment connecting them is perfectly horizontal or vertical. In these cases, using the full distance formula is unnecessary.
For a horizontal segment, the -coordinates are identical. The distance is the absolute difference between the changing -coordinates.
For a vertical segment, the -coordinates are identical. The distance is the absolute difference between the changing -coordinates.

Use exact values and sensible approximations
The result of the distance formula often involves a square root that does not simplify to a whole number.
An exact value leaves the distance in radical form, such as or . This format preserves perfect mathematical accuracy and is preferred in algebra and geometry proofs.
A decimal approximation evaluates the square root, typically rounded to one or two decimal places, such as . This format is useful for real-world applications where a measurable length is needed. Always check which format the context requires.
Worked examples
These examples demonstrate how to find the length between coordinates in different scenarios.
Example 1: Calculating standard distance
Question: What is the exact distance between the points and ?
Method:
- Assign and .
- Substitute into the distance formula: .
- .
- .
- .
- .
Answer: The distance is units.
Check: A right triangle with legs of and forms a Pythagorean triple , confirming the hypotenuse is indeed .
Example 2: Checking side lengths of a geometric figure
Question: A triangle has vertices at , , and . Find the lengths of all three sides to determine if it is a right-angled triangle.

Method:
- Find the vertical side . Since the -coordinates are both , subtract the -coordinates: .
- Find the horizontal side . Since the -coordinates are both , subtract the -coordinates: .
- Find the hypotenuse using the distance formula: .
- .
- Check the Pythagorean theorem: , which simplifies to .
Answer: The side lengths are , , and . Because they satisfy the Pythagorean theorem, it is a right-angled triangle.
Check: Once side lengths are confirmed, this information can be used to classify the shape or calculate the area of a triangle from coordinates.
Example 3: Finding an unknown coordinate
Question: The distance between and is units. What are the possible values for ?
Method:
- Set up the distance formula: .
- Square both sides to remove the radical: .
- Simplify the known square: .
- Subtract from both sides: .
- Take the square root of both sides, remembering to include both positive and negative roots: .
- Solve for the first case: yields .
- Solve for the second case: yields .
Answer: The possible values are or .
Check: Substitute back into the formula: . Both values satisfy the equation.
Common mistakes
Forgetting to square the differences
A frequent error is finding the difference between coordinates but forgetting to apply the exponent of two before adding them together. The formula strictly relies on the squares of the triangle's legs.
Adding instead of subtracting coordinates
The distance formula measures the difference between coordinates to find the length of a side. Adding and will locate a completely different position on the plane instead of measuring a length.
Writing a negative result
Distance represents a physical length. While coordinate differences can be negative, squaring them makes them positive. The final principal square root must always be a positive number or zero.
Frequently asked questions
Does the order of the points matter?
No, the order does not matter. Calculating gives the opposite sign of , but squaring the result produces the identical positive number in both cases.
Can the distance formula be used in three dimensions?
Yes, the formula expands naturally into three dimensions. For points and , the spatial length is calculated as .
What other formulas use coordinates?
Once you know how to find the length between two points, you can explore the midpoint formula to locate the exact centre of a segment, or calculate the slope of a line to describe its steepness. These are core tools needed for exploring formal coordinate geometry proofs.
Practice questions

What is the exact distance between the two points shown on the coordinate plane?

What is the length of the line segment?
What is the exact distance between the points and ?

A student calculated the distance between and as units. What error did the student most likely make?
They added the horizontal and vertical differences instead of using the Pythagorean theorem.
They forgot to take the square root at the end of the calculation.
They subtracted the -coordinates from the -coordinates.
They added the given coordinates together instead of finding the differences.
They added the horizontal and vertical differences instead of using the Pythagorean theorem.
Which of the following is a possible -coordinate if the distance between and is units?
