Skip to main content
ponderloop

Complex Number Calculator

(3 + 4i) × (1 − 2i) = 11 − 2i, computed exactly. With the same two numbers, z + w = 4 + 2i, z − w = 2 + 6i, z ÷ w = −1 + 2i, the modulus |z| is 5 and the argument of z is 53.130102°. Type each number as 3+4i, 3 - 4i, i, -2i, 5 or a fraction such as 1/2+3/4i, then pick add, subtract, multiply, divide, conjugate, modulus, argument, polar form, a power from −50 to 50, square roots or roots of unity: the algebra stays in exact fractions, and angles and decimals come to the number of significant digits you choose.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Type a complex number like 3+4i, 3 - 4i, 5, i, -2i, 1/2+3/4i or 2.5-0.5i. Both i and j work; fractions and decimals are read exactly, and 3/4i means (3/4)i.

(3 + 4i) × (1 − 2i) = 11 − 2i

(a + bi)(c + di) = (ac − bd) + (ad + bc)i, because i² = −1.

Real part
11
Imaginary part
−2
Modulus of the result
5√5 ≈ 11.18034
Argument of the result
−10.304846° (−0.1798535 rad)

Every part is an exact fraction; nothing is rounded.

The working

  1. Write z = a + bi and w = c + di with a = 3, b = 4, c = 1 and d = −2.
  2. Real part, ac − bd = 3·1 − 4·(−2) = 11.
  3. Imaginary part, ad + bc = 3·(−2) + 4·1 = −2.
  4. So z × w = 11 − 2i. The term bd·i² became −bd because i² = −1.

Every operation on z = 3 + 4i and w = 1 − 2i

Each result is the calculator’s own answer for the example numbers; the argument and the polar forms are decimals to 8 significant digits.
OperationWritten asResult
Addz + w4 + 2i
Subtractz − w2 + 6i
Multiplyz × w11 − 2i
Dividez ÷ w−1 + 2i
Conjugateconj(z)3 − 4i
Modulus|z|5
Argumentarg z0.92729522 rad ≈ 53.130102°
Polar formr(cos θ + i sin θ)5 (cos 0.92729522 + i sin 0.92729522)
Exponential formr e^(iθ)5 e^(i·0.92729522)
Squarez²−7 + 24i
Square roots√z±(2 + i)

Formulas for each operation

The rule behind every operation and whether the calculator gives an exact answer or a decimal.
OperationFormulaResult type
Add or subtract(a + bi) ± (c + di) = (a ± c) + (b ± d)iExact
Multiply(a + bi)(c + di) = (ac − bd) + (ad + bc)iExact
Divide(a + bi) ÷ (c + di) = ((ac + bd) + (bc − ad)i) ÷ (c² + d²)Exact; undefined when c + di = 0
Conjugateconj(a + bi) = a − bi, and z · conj(z) = a² + b²Exact
Modulus|z| = √(a² + b²)Exact when a² + b² is a perfect square, else a radical and a decimal
Argumentarg z = atan2(b, a), principal value in (−π, π]Decimal; exact multiple of 45° on the axes and diagonals
Polar and exponential formz = r(cos θ + i sin θ) = r e^(iθ), r = |z|, θ = arg zDecimal with your digits
Integer powerzⁿ by repeated multiplication; (r e^(iθ))ⁿ = rⁿ e^(inθ) (De Moivre)Exact for |n| ≤ 50
Square root√z = ±(√((r + a)/2) + sign(b) √((r − a)/2) i)Exact when r = |z| is rational, else decimal
Roots of unitye^(2πik/n) = cos(2πk/n) + i sin(2πk/n), k = 0 … n − 1Exact for n = 1, 2, 3, 4, 6, 8, 12, else decimal

Powers of i: the cycle of four

Each entry is the calculator’s exact power of i. The result depends only on the exponent’s remainder on division by 4: 0 gives 1, 1 gives i, 2 gives −1 and 3 gives −i.
PowerExponent mod 4Value
i^−31i
i^−22−1
i^−13−i
i^001
i^11i
i^22−1
i^33−i
i^401
i^51i
i^62−1
i^73−i
i^801
i^102−1
i^171i
i^233−i
i^502−1

Euler’s identity: values of e^(iθ) at the special angles

e^(iθ) = cos θ + i sin θ for every multiple of 30° and 45°, exact and to 8 significant digits. The row for π is Euler’s identity: e^(iπ) = −1, so e^(iπ) + 1 = 0.
θ in radiansθ in degreese^(iθ) exacte^(iθ) decimal
00°11
π/630°√3/2 + (1/2)i0.8660254 + 0.5i
π/445°√2/2 + (√2/2)i0.70710678 + 0.70710678i
π/360°1/2 + (√3/2)i0.5 + 0.8660254i
π/290°ii
2π/3120°−1/2 + (√3/2)i−0.5 + 0.8660254i
3π/4135°−√2/2 + (√2/2)i−0.70710678 + 0.70710678i
5π/6150°−√3/2 + (1/2)i−0.8660254 + 0.5i
π180°−1−1
7π/6210°−√3/2 − (1/2)i−0.8660254 − 0.5i
5π/4225°−√2/2 − (√2/2)i−0.70710678 − 0.70710678i
4π/3240°−1/2 − (√3/2)i−0.5 − 0.8660254i
3π/2270°−i−i
5π/3300°1/2 − (√3/2)i0.5 − 0.8660254i
7π/4315°√2/2 − (√2/2)i0.70710678 − 0.70710678i
11π/6330°√3/2 − (1/2)i0.8660254 − 0.5i
2π360°11

Argument and polar form of points on the axes, the diagonals and two other points

Each row is the calculator’s polar form of the number in the first column, to 8 significant digits; exact angles appear as multiples of π.
zModulus rArgument in radiansArgument in degreesPolar form
1100°cos 0 + i sin 0
1 + i√2 ≈ 1.4142136π/4 ≈ 0.7853981645°√2 (cos π/4 + i sin π/4)
i1π/2 ≈ 1.570796390°cos π/2 + i sin π/2
−1 + i√2 ≈ 1.41421363π/4 ≈ 2.3561945135°√2 (cos 3π/4 + i sin 3π/4)
−11π ≈ 3.1415927180°cos π + i sin π
−1 − i√2 ≈ 1.4142136−3π/4 ≈ −2.3561945−135°√2 (cos (−3π/4) + i sin (−3π/4))
−i1−π/2 ≈ −1.5707963−90°cos (−π/2) + i sin (−π/2)
1 − i√2 ≈ 1.4142136−π/4 ≈ −0.78539816−45°√2 (cos (−π/4) + i sin (−π/4))
3 + 4i50.9272952253.130102°5 (cos 0.92729522 + i sin 0.92729522)
−3 − 4i5−2.2142974−126.8699°5 (cos (−2.2142974) + i sin (−2.2142974))

Complex number calculator worked examples

Eight problems with the calculator’s own answers.
ProblemResultHow it works
(2 + 3i) + (4 − i)6 + 2iAdd real parts and imaginary parts separately.
(1/2 + 3/4i)(2 − i)7/4 + iMultiply with i² = −1; the fractions stay exact.
(1 + i) ÷ (1 − i)iMultiply top and bottom by 1 + i; the bottom becomes 2.
i^27−i27 leaves remainder 3 on division by 4, and i³ = −i.
|5 − 12i|13√(25 + 144) = √169, a perfect square.
√(−5 + 12i)±(2 + 3i)The modulus 13 is rational, so both parts of the root are exact.
arg(−1 − i)−3π/4 ≈ −2.3561945 rad = −135°atan2 puts the point in Quadrant III, on the line |a| = |b|.
(1 + i)^816(1 + i)² = 2i, so (1 + i)⁸ = (2i)⁴ = 16.

How to calculate with complex numbers

  1. Choose the operation. Pick add, subtract, multiply, divide, conjugate, modulus, argument, polar form, power, square roots or roots of unity. Only the boxes the operation needs stay visible.
  2. Type the complex numbers. Write each as a real part plus an imaginary part: 3+4i, 3 - 4i, i, -2i, 5, 1/2+3/4i or 2.5-0.5i. For two numbers enter z first and w second, for example 3+4i and 1-2i.
  3. Set the power or the number of roots. For a power type a whole number n from −50 to 50, for example (1 + i)^2 = 2i. For roots of unity type how many roots you want, from 1 to 12.
  4. Pick the significant digits. Angles, polar forms and decimals use 3 to 15 significant digits: √(1 + i) shows as 1.099 + 0.4551i at 4 digits and 1.09868411347 + 0.455089860562i at 12.
  5. Read the result and the working. For 3+4i times 1-2i the tool shows 11 − 2i with its real part, imaginary part, modulus and argument, then each step of the working. Copy the results to keep them.

Frequently asked questions

How do you add and subtract complex numbers?
Add or subtract the real parts and the imaginary parts separately: (a + bi) ± (c + di) = (a ± c) + (b ± d)i. For z = 3 + 4i and w = 1 − 2i, z + w = 4 + 2i and z − w = 2 + 6i. Fractions and decimals work the same way, and the parts are kept as exact fractions, so nothing is rounded.
How do you multiply complex numbers?
Multiply out as with two brackets and replace i² by −1: (a + bi)(c + di) = (ac − bd) + (ad + bc)i. The example gives (3 + 4i) × (1 − 2i) = 11 − 2i. With fractions the arithmetic is exact too: (1/2 + 3/4i)(2 − i) = 7/4 + i. Multiplying i by itself gives −1, which is where the definition i² = −1 comes from.
How do you divide complex numbers, and what if the divisor is 0?
Multiply the top and the bottom by the conjugate of the divisor, which turns the bottom into the real number c² + d². The example gives (3 + 4i) ÷ (1 − 2i) = −1 + 2i. Dividing by 0 + 0i has no answer, and the tool says so instead of showing a number: “Division by zero: w is 0, so (3 + 4i) ÷ w is undefined. Change w to a nonzero complex number.”
What is the modulus of a complex number?
The modulus |z| = √(a² + b²) is the distance from 0 to the point (a, b). |3 + 4i| = 5 because 3² + 4² = 25 is a perfect square, so the answer is exact. When the sum is not a perfect square the answer is a radical with its decimal, for example |2 + 3i| = √13 ≈ 3.6055513. The modulus is also the square root of z times its conjugate: (3 + 4i)(3 − 4i) = 25, and √25 = 5.
How do you find the argument (angle) of a complex number?
The argument is the angle from the positive real axis to the point (a, b), found with atan2(b, a) so the quadrant is right: arg(3 + 4i) ≈ 0.92729522 rad ≈ 53.130102°. The principal value is in (−π, π]; add 360° to a negative angle to get 0° to 360°. On the axes and on the lines |a| = |b| the angle is an exact multiple of 45°, shown as a multiple of π: arg(−1 − i) = −3π/4 ≈ −2.3561945 rad = −135°. With rational real and imaginary parts the angle can never be exactly 30° or 60°, because tan 30° = √3/3 is irrational. The argument of 0 is undefined, and the tool says: “The argument of 0 is undefined: the point (0, 0) has no direction. Type a nonzero number.”
What are polar form and exponential form?
Polar form writes z by its distance and its angle: z = r(cos θ + i sin θ) with r = |z| and θ = arg z. Euler’s formula e^(iθ) = cos θ + i sin θ turns that into the exponential form z = r e^(iθ). For 3 + 4i the tool shows 5 (cos 0.92729522 + i sin 0.92729522) and 5 e^(i·0.92729522). For 1 + i the modulus and angle are exact: 1 + i = √2 (cos π/4 + i sin π/4), and −2i is 2 e^(−iπ/2). Radians and degrees are both shown.
How do you raise a complex number to a power?
Multiply it by itself n times (the tool does this exactly, by repeated squaring), or use De Moivre’s theorem: (r e^(iθ))ⁿ = rⁿ e^(inθ), so the modulus is raised to n and the angle is multiplied by n. (3 + 4i)² = −7 + 24i, (1 + i)⁸ = 16 and even (1 + i)⁵⁰ = 33554432i is exact. A negative power is the reciprocal: (1 + i)^(−3) = −1/4 − (1/4)i. Powers from −50 to 50 are accepted, and anything outside that range or not a whole number is refused with a message in words.
What are the powers of i?
They repeat in a cycle of four: i⁰ = 1, i¹ = i, i² = −1, i³ = −i, i⁴ = 1 again. To find iⁿ divide n by 4 and use the remainder: i^27 leaves remainder 3, so i^27 = −i. The table above lists the tool’s answers for negative and large exponents too. The cycle works because i² = −1 and so i⁴ = (i²)² = 1.
How do you find the square root of a complex number?
Every nonzero complex number has two square roots, one the negative of the other. For z = a + bi with modulus r, x = √((r + a)/2) and y = ±√((r − a)/2), with the sign of b. √(3 + 4i) = ±(2 + i), and √(−4) = ±2i. When the modulus is rational both parts are exact, even as radicals: √i = ±(√2/2 + (√2/2)i). When it is not, only decimals are shown: √(1 + i) ≈ ±(1.0986841 + 0.45508986i) at 8 digits.
What are the roots of unity?
The n-th roots of unity are the n solutions of zⁿ = 1: e^(2πik/n) for k = 0 to n − 1, evenly spaced points on the unit circle. The cube roots are 1, −1/2 + (√3/2)i and −1/2 − (√3/2)i. The tool lists every root for n from 1 to 12, with exact radicals when the angle is a multiple of 30° or 45° (n = 1, 2, 3, 4, 6, 8, 12), and decimals otherwise: the 5th roots start with 1, 0.30901699 + 0.95105652i, −0.80901699 + 0.58778525i. Their sum is 0 for every n above 1, and they are the corners of a regular n-gon: the 12th roots are π/6 rad = 30° apart.
What is Euler’s identity?
Euler’s formula is e^(iθ) = cos θ + i sin θ. At θ = π it gives e^(iπ) = −1, so e^(iπ) + 1 = 0, Euler’s identity; at θ = π/2 it gives e^(iπ/2) = i. The table above lists e^(iθ) at every multiple of 30° and 45°, exact and as a decimal.
What can I type into the boxes?
A sum of a real number and an imaginary number, in either order: 3+4i, 3 - 4i, 2i+3, i, -2i, 5, 2.5-0.5i, or fractions such as 1/2+3/4i (which means 1/2 plus three quarters of i: 3/4i is read as (3/4)i). Spaces are ignored, j works like i, and brackets are allowed: (3+4i). For example “1/2+3/4i” is read as 1/2 + (3/4)i. Anything else gets an error message in words instead of a result.
How accurate is it, and when are decimals used?
Add, subtract, multiply, divide, conjugate and integer powers are exact: the parts are fractions of big integers, so nothing is rounded. Modulus and square roots are exact where the answer is rational or a simple radical. The argument, the polar and exponential form and the roots of unity are real-valued, so they are double-precision decimals (about 15 significant digits) shown to the number of digits you choose. Those decimals were checked against Python’s cmath to within 1e-12. For example √(1 + i) is 1.099 + 0.4551i at 4 digits and 1.09868411347 + 0.455089860562i at 12.

How it works

Each complex number is read as a real part and an imaginary part, each an exact fraction of two BigInts (decimals such as 2.5 become 5/2). Addition, subtraction, multiplication, division by the conjugate, conjugates and integer powers use only exact fraction arithmetic, so the results are exact. The modulus is the square root of the exact sum a² + b²: a rational number when that sum is a perfect square of a fraction, otherwise k√m/q with the square factors taken out of m. The principal square root uses x = √((r + a)/2) and y = sign(b)·√((r − a)/2) with r = |z|; when r is rational each part is a rational or a simple radical, otherwise the parts are computed in double precision with a cancellation-free form. The argument is atan2(b, a) in double precision and is exact (a multiple of π/4) only on the axes and the lines |a| = |b|. The polar form r(cos θ + i sin θ) and the exponential form r e^(iθ) use the exact modulus where there is one and the angle to your chosen digits. The roots of unity e^(2πik/n) are exact when 2πk/n is a multiple of 30° or 45° and cos and sin of 2πk/n in double precision otherwise. Decimals are rounded for display to 3 to 15 significant digits, with an exponent below 1e-6 and from 1e15. The decimals were tested against independent values from Python’s cmath module (abs, phase, sqrt and exp) to 1e-12, and the exact results against Python’s fractions module.

Sources

More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators