Skip to content
FiftyCalc Free calculators for all 50 states

Distance Between Two Points Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter the coordinates of two points (leave z at 0 for points in a plane) to get the distance between them.

Result

Sample figures

Distance—

Δx = x₂ − x₁ —

  • Δy = y₂ − y₁—
  • Δz = z₂ − z₁—
  • Midpoint x—
  • Midpoint y—
  • Midpoint z—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Distance Between Two Points Calculator

Point 1: x₁: enter a number. Prefilled example: 1.

Point 1: y₁: enter a number. Prefilled example: 2.

Point 1: z₁ (0 for 2D): enter a number. Prefilled example: 0.

Point 2: x₂: enter a number. Prefilled example: 4.

Point 2: y₂: enter a number. Prefilled example: 6.

Point 2: z₂ (0 for 2D): enter a number. Prefilled example: 0.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Point 1: x₁: enter a number.
  2. Point 1: y₁: enter a number.
  3. Point 1: z₁ (0 for 2D): enter a number.
  4. Point 2: x₂: enter a number.
  5. Point 2: y₂: enter a number.
  6. Point 2: z₂ (0 for 2D): enter a number.
  7. Read the result: Distance; the panel also shows Δx = x₂ − x₁, Δy = y₂ − y₁, Δz = z₂ − z₁, Midpoint x, Midpoint y and Midpoint z.

How this calculator works

The distance formula comes from the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²) in the plane, and d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²) in space.

The midpoint is the average of the coordinates: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2, (z₁ + z₂) ÷ 2). The distance is in the same unit as the coordinates.

The formula

  1. D=(x2−x1)2+(y2−y1)2+(z2−z1)2
Symbols used in the formula
SymbolMeaning
x1Point 1: x₁
y1Point 1: y₁
z1Point 1: z₁ (0 for 2D)
x2Point 2: x₂
y2Point 2: y₂
z2Point 2: z₂ (0 for 2D)
DDistance

Worked example

Point 1: x₁1
Point 1: y₁2
Point 1: z₁ (0 for 2D)0
Point 2: x₂4
Point 2: y₂6
Point 2: z₂ (0 for 2D)0
Δx = x₂ − x₁3
Δy = y₂ − y₁4
Δz = z₂ − z₁0
Midpoint x2.5
Midpoint y4
Midpoint z0
  1. D=(4−1)2+(6−2)2+(0−0)2=5

Distance 5

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the distance between (1, 2) and (4, 6)?

√(3² + 4²) = √25 = 5.

Does the order of the points matter?

No. The differences are squared, so swapping the points gives the same distance.

How do you find the distance in 3D?

Add the squared z difference under the square root: from (0, 0, 0) to (1, 2, 2) the distance is √9 = 3.

Questions answered

Related calculators