Skip to the formula

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

The distance formula is d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²).

What each letter means

When to use it

To find the length of a line segment from the coordinates of its ends. It is Pythagoras on the horizontal and vertical gaps.

Worked example

Find the distance between \(A(1,-2,4)\) and \(B(4,2,-8)\).

  1. \(d=\sqrt{(1-4)^2+(-2-2)^2+(4-(-8))^2}=\sqrt{9+16+144}\)

Answer: \(d=\sqrt{169}=13\)

Common mistake

Squaring a negative wrongly: (−6)² = 36, not −36. Put negative differences in brackets.

On your course

CourseIn the exam
AA SLIn the IB formula booklet
AI SLIn the IB formula booklet
AA HLIn the IB formula booklet
AI HLIn the IB formula booklet

From our own IB Maths formula sheets, in our words. The IB gives its booklet to schools, so we checked against our own copy: your teacher has the official one. Official: IB DP Mathematics page.

Practise and revise

Distance formula formula card: d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²). IB Math Revision
Distance formula formula card. Download the card (PNG) to save or print it.

Questions

What is the distance formula?

The distance formula is d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²). d: the distance between the two points; (x₁, y₁, z₁), (x₂, y₂, z₂): the two points (leave out z in 2D).

Is the distance formula given in the exam?

AA SL: in the IB formula booklet. AI SL: in the IB formula booklet. AA HL: in the IB formula booklet. AI HL: in the IB formula booklet. This comes from our own IB Maths formula sheets; your teacher has the official booklet.

How is the distance formula related to Pythagoras?

The horizontal and vertical gaps between the points are the two shorter sides of a right-angled triangle, so the distance is its hypotenuse.

Our own wording, examples and card, checked by IB Math Revision. Not produced or endorsed by the International Baccalaureate Organization.