Education

Distance Formula Calculator

Last updated: June 19, 2026

Blake Boege
Written by Blake Boege · Founder, Calculator Answers

A distance formula calculator is a geometric tool used to find the Euclidean distance between two coordinate pairs on a Cartesian plane. It applies the Pythagorean theorem-based distance formula to compute the straight-line distance using the horizontal and vertical differences between the points. The tool delivers the final value in simplified radical form for mathematical precision, as well as decimal approximations for practical measurement. Students, land surveyors, and designers use it to map coordinates and verify dimensions.

Enter the coordinates of two points and we compute the straight-line distance between them. The result shows the horizontal and vertical changes, the squared differences, and the final distance, with the exact radical form when it lands on one.

Quick Answer

Calculate the straight-line distance between two points in a two-dimensional coordinate plane. Enter the coordinates of both points to see decimal and exact radical answers.

Coordinates

Enter two points (x₁, y₁) and (x₂, y₂).

e.g. 1

e.g. 2

e.g. 4

e.g. 6

Step by step

  1. 1. Identify the coordinates. x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 6.
  2. 2. Subtract x coordinates. Δx = 41 = 3.
  3. 3. Subtract y coordinates. Δy = 62 = 4.
  4. 4. Square both differences. Δx² = 9, Δy² = 16.
  5. 5. Add the squared differences. 9 + 16 = 25.
  6. 6. Take the square root. d = √25 = 5.
Distance

d =

5

From (1, 2) to (4, 6)

Point 1(1, 2)
Point 2(4, 6)
Δx (x₂ − x₁)3
Δy (y₂ − y₁)4
Δx² + Δy²25
d (distance)5

The distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²) is the Pythagorean theorem applied to the right triangle whose legs are the horizontal and vertical changes between the two points.

Was this helpful?

Examples

(1, 2) and (4, 6)

d = 5

(0, 0) and (3, 4)

d = 5

(−2, 3) and (4, −5)

d = 10

(0, 0) and (1, 1)

d = √2 ≈ 1.4142

How it works

For any two points (x₁, y₁) and (x₂, y₂) on a coordinate plane, the distance between them is:

Distance · d = √((x₂ − x₁)² + (y₂ − y₁)²)

The horizontal change x₂ − x₁ and the vertical change y₂ − y₁ are the two legs of a right triangle whose hypotenuse is the distance you want. That is why this formula is just the Pythagorean theorem applied to coordinates.

What is the distance formula?

The distance formula is an algebraic tool used to find the shortest, straight-line distance between two points in a two-dimensional Cartesian coordinate system. It translates geometric length into numerical form using the coordinates of the endpoints.

How to find the distance between two points step-by-step

To calculate the distance between Point 1 (x₁, y₁) and Point 2 (x₂, y₂):

  1. Subtract x₁ from x₂ to find the horizontal distance (the "run").
  2. Subtract y₁ from y₂ to find the vertical distance (the "rise").
  3. Square both differences separately to make them positive numbers.
  4. Add the two squared values together.
  5. Take the square root of that sum to find the final distance.

The connection to the Pythagorean theorem

The distance formula is a direct application of the Pythagorean theorem (a² + b² = c²). If you plot two points on a graph and draw horizontal and vertical lines from them, they meet to form a right triangle. The horizontal leg has a length of |x₂ − x₁|, and the vertical leg has a length of |y₂ − y₁|. The straight line connecting the points is the hypotenuse. Solving for the hypotenuse gives you the standard distance equation.

Worked example: Finding distance with negative coordinates

Let's find the distance between the points (−2, 3) and (4, −5):

  • Label coordinates: x₁ = -2, y₁ = 3, x₂ = 4, y₂ = -5
  • Find horizontal change: x₂ − x₁ = 4 − (−2) = 6
  • Find vertical change: y₂ − y₁ = −5 − 3 = −8
  • Square the changes: 6² = 36, and (−8)² = 64
  • Sum the squares: 36 + 64 = 100
  • Take the square root: √100 = 10

The distance between the two points is exactly 10.

Common mistakes when using the distance formula

  • Incorrect handling of negative signs: Forgetting that subtracting a negative number results in addition, for instance writing 4 − (−2) as 4 − 2 = 2 instead of 4 + 2 = 6.
  • Mixing up coordinates: Matching an x-coordinate with a y-coordinate during subtraction (e.g. computing x₂ − y₁ instead of x₂ − x₁).
  • Forgetting the square root: Adding the squared differences and leaving the sum as the final answer without applying the final square root step.
  • Adding before squaring: Summing the differences and then squaring the result, which yields the incorrect math (x₂ - x₁ + y₂ - y₁)².

Frequently asked questions

The distance formula is d = √((x₂ − x₁)² + (y₂ − y₁)²). It returns the straight-line distance between two points (x₁, y₁) and (x₂, y₂) in a 2D coordinate plane. The formula comes directly from the Pythagorean theorem applied to the right triangle formed by the horizontal and vertical changes between the points.

Subtract the x-coordinates to get the horizontal change. Subtract the y-coordinates to get the vertical change. Square both differences, add the squares together, and take the square root. The result is the distance.

(x₁, y₁) and (x₂, y₂) are the two points you want to measure between. The numbered subscripts just label which point is which. The formula gives the same answer regardless of which point you call point 1 and which you call point 2, because the differences get squared.

No. Distance is always zero or positive. The formula squares the differences before taking the square root, which removes any negative sign. A distance of zero only happens when both points are the same.

Yes. Negative coordinates are fine on either or both points. The formula computes (x₂ − x₁) and (y₂ − y₁) correctly regardless of sign, and the squaring step handles the rest.

Yes. The distance formula is the Pythagorean theorem in disguise. The horizontal change (x₂ − x₁) and vertical change (y₂ − y₁) form the two legs of a right triangle, and the distance between the points is the hypotenuse. So d² = (x₂ − x₁)² + (y₂ − y₁)² is just a² + b² = c² with different labels.

Yes. The four coordinate fields accept decimals and negative numbers. The result is computed in full floating-point precision; the displayed value is rounded for readability, and when the answer is a clean integer or has a simple radical form, that exact form is shown alongside the decimal.

For three dimensions, you add the squared difference of the z-coordinates under the square root: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). This extension of the distance formula works for any number of dimensions.