Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Distance Between Complex Numbers Calculator

How to use
  1. Type the first number z1z_1 in Re z₁ and Im z₁, and the second number z2z_2 in Re z₂ and Im z₂.
  2. Read the distance ∣z1−z2∣|z_1 - z_2|, exact where possible with a decimal beside it. Learn more about reading the answer
  3. Read the midpoint, the number halfway between the two.
  4. On the complex plane the navy segment joins the two numbers; the dashed legs are the differences of the real and of the imaginary parts; the hollow dot is the midpoint.
  5. How it was found shows the subtraction and the modulus.

Distance and midpoint
Distance
∣z1−z2∣=5\displaystyle |z_1 - z_2| = 5
Difference
z1−z2=−3−4 i\displaystyle z_1 - z_2 = -3 - 4\,i
Midpoint
z1+z22=52+4 i\displaystyle \frac{z_1 + z_2}{2} = \frac{5}{2} + 4\,i
How it was found

The distance between two complex numbers is the modulus of their difference. First subtract: z1−z2=(1+2 i)−(4+6 i)=−3−4 iz_1 - z_2 = (1 + 2\,i) - (4 + 6\,i) = -3 - 4\,i.

Then take the modulus: (−3)2+(−4)2=25=5\sqrt{(-3)^2 + (-4)^2} = \sqrt{25} = 5.

On the picture the two dashed legs are the differences of the real parts (blue) and of the imaginary parts (amber); the distance is the hypotenuse.

The midpoint is the average of the two numbers, part by part: 1+42=2.5\dfrac{1 + 4}{2} = 2.5 and 2+62=4\dfrac{2 + 6}{2} = 4.

The order does not matter: ∣z1−z2∣=∣z2−z1∣|z_1 - z_2| = |z_2 - z_1|.



Finding the distance

DemoDistance and midpoint of two numbers
Step 0 of 3
The distance between two complex numbers z1=a+biz_1 = a + bi and z2=c+diz_2 = c + di is the modulus of their difference:

∣z1−z2∣=(a−c)2+(b−d)2|z_1 - z_2| = \sqrt{(a - c)^2 + (b - d)^2}


Type the two numbers and the calculator subtracts them, then takes the modulus.

Reading the answer

  • Distance is ∣z1−z2∣|z_1 - z_2|. It is written exactly when the number under the root is whole, for example 10\sqrt{10}, with a decimal beside it.
  • Difference is z1−z2z_1 - z_2, the arrow from z2z_2 to z1z_1.
  • Midpoint is z1+z22\dfrac{z_1 + z_2}{2}, given with exact halves.

Where the formula comes from

On the complex plane z1z_1 and z2z_2 are the points (a, b)(a,\ b) and (c, d)(c,\ d). The horizontal gap between them is ∣a−c∣|a - c| and the vertical gap is ∣b−d∣|b - d|. These are the legs of a right triangle whose hypotenuse is the segment joining the two points.

The Pythagorean theorem gives the length of that hypotenuse. It is the ordinary distance formula of coordinate geometry, written for complex numbers.
The legs are the differences of the real parts and of the imaginary parts.

The midpoint

The midpoint is the average of the two numbers:

z1+z22=a+c2+b+d2 i\dfrac{z_1 + z_2}{2} = \dfrac{a + c}{2} + \dfrac{b + d}{2}\,i


It lies on the segment joining them, at the same distance from each. The average of the real parts gives its real part, and the average of the imaginary parts its imaginary part.

Distance from the origin and circles

DemoDistance from the origin
Step 0 of 2
When z2=0z_2 = 0 the distance is just ∣z1∣|z_1|: the modulus is the distance from the origin.

More generally, the equation ∣z−z0∣=r|z - z_0| = r describes all numbers at distance rr from z0z_0, which is a circle of radius rr centred at z0z_0. The inequality ∣z−z0∣<r|z - z_0| < r describes the inside of that circle.
All numbers zz with ∣z−(1+i)∣=3|z - (1 + i)| = 3: a circle of radius 33 centred at 1+i1 + i.

Common mistakes

  • Subtracting the moduli. The distance is ∣z1−z2∣|z_1 - z_2|, not ∣z1∣−∣z2∣|z_1| - |z_2|.
  • Forgetting to square. The legs are squared before they are added.
  • Losing a sign. With z2=1−4iz_2 = 1 - 4i the vertical gap from 2i2i is 2−(−4)=62 - (-4) = 6.
  • Halving the difference for the midpoint. The midpoint is half the sum, not half the difference.