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
(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.
All the roots
The working
- Write z = a + bi and w = c + di with a = 3, b = 4, c = 1 and d = −2.
- Real part, ac − bd = 3·1 − 4·(−2) = 11.
- Imaginary part, ad + bc = 3·(−2) + 4·1 = −2.
- So z × w = 11 − 2i. The term bd·i² became −bd because i² = −1.
Every operation on z = 3 + 4i and w = 1 − 2i
| Operation | Written as | Result |
|---|---|---|
| Add | z + w | 4 + 2i |
| Subtract | z − w | 2 + 6i |
| Multiply | z × w | 11 − 2i |
| Divide | z ÷ w | −1 + 2i |
| Conjugate | conj(z) | 3 − 4i |
| Modulus | |z| | 5 |
| Argument | arg z | 0.92729522 rad ≈ 53.130102° |
| Polar form | r(cos θ + i sin θ) | 5 (cos 0.92729522 + i sin 0.92729522) |
| Exponential form | r e^(iθ) | 5 e^(i·0.92729522) |
| Square | z² | −7 + 24i |
| Square roots | √z | ±(2 + i) |
Formulas for each operation
| Operation | Formula | Result type |
|---|---|---|
| Add or subtract | (a + bi) ± (c + di) = (a ± c) + (b ± d)i | Exact |
| Multiply | (a + bi)(c + di) = (ac − bd) + (ad + bc)i | Exact |
| Divide | (a + bi) ÷ (c + di) = ((ac + bd) + (bc − ad)i) ÷ (c² + d²) | Exact; undefined when c + di = 0 |
| Conjugate | conj(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 |
| Argument | arg z = atan2(b, a), principal value in (−π, π] | Decimal; exact multiple of 45° on the axes and diagonals |
| Polar and exponential form | z = r(cos θ + i sin θ) = r e^(iθ), r = |z|, θ = arg z | Decimal with your digits |
| Integer power | zⁿ 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 unity | e^(2πik/n) = cos(2πk/n) + i sin(2πk/n), k = 0 … n − 1 | Exact for n = 1, 2, 3, 4, 6, 8, 12, else decimal |
Powers of i: the cycle of four
| Power | Exponent mod 4 | Value |
|---|---|---|
| i^−3 | 1 | i |
| i^−2 | 2 | −1 |
| i^−1 | 3 | −i |
| i^0 | 0 | 1 |
| i^1 | 1 | i |
| i^2 | 2 | −1 |
| i^3 | 3 | −i |
| i^4 | 0 | 1 |
| i^5 | 1 | i |
| i^6 | 2 | −1 |
| i^7 | 3 | −i |
| i^8 | 0 | 1 |
| i^10 | 2 | −1 |
| i^17 | 1 | i |
| i^23 | 3 | −i |
| i^50 | 2 | −1 |
Euler’s identity: values of e^(iθ) at the special angles
| θ in radians | θ in degrees | e^(iθ) exact | e^(iθ) decimal |
|---|---|---|---|
| 0 | 0° | 1 | 1 |
| π/6 | 30° | √3/2 + (1/2)i | 0.8660254 + 0.5i |
| π/4 | 45° | √2/2 + (√2/2)i | 0.70710678 + 0.70710678i |
| π/3 | 60° | 1/2 + (√3/2)i | 0.5 + 0.8660254i |
| π/2 | 90° | i | i |
| 2π/3 | 120° | −1/2 + (√3/2)i | −0.5 + 0.8660254i |
| 3π/4 | 135° | −√2/2 + (√2/2)i | −0.70710678 + 0.70710678i |
| 5π/6 | 150° | −√3/2 + (1/2)i | −0.8660254 + 0.5i |
| π | 180° | −1 | −1 |
| 7π/6 | 210° | −√3/2 − (1/2)i | −0.8660254 − 0.5i |
| 5π/4 | 225° | −√2/2 − (√2/2)i | −0.70710678 − 0.70710678i |
| 4π/3 | 240° | −1/2 − (√3/2)i | −0.5 − 0.8660254i |
| 3π/2 | 270° | −i | −i |
| 5π/3 | 300° | 1/2 − (√3/2)i | 0.5 − 0.8660254i |
| 7π/4 | 315° | √2/2 − (√2/2)i | 0.70710678 − 0.70710678i |
| 11π/6 | 330° | √3/2 − (1/2)i | 0.8660254 − 0.5i |
| 2π | 360° | 1 | 1 |
Argument and polar form of points on the axes, the diagonals and two other points
| z | Modulus r | Argument in radians | Argument in degrees | Polar form |
|---|---|---|---|---|
| 1 | 1 | 0 | 0° | cos 0 + i sin 0 |
| 1 + i | √2 ≈ 1.4142136 | π/4 ≈ 0.78539816 | 45° | √2 (cos π/4 + i sin π/4) |
| i | 1 | π/2 ≈ 1.5707963 | 90° | cos π/2 + i sin π/2 |
| −1 + i | √2 ≈ 1.4142136 | 3π/4 ≈ 2.3561945 | 135° | √2 (cos 3π/4 + i sin 3π/4) |
| −1 | 1 | π ≈ 3.1415927 | 180° | cos π + i sin π |
| −1 − i | √2 ≈ 1.4142136 | −3π/4 ≈ −2.3561945 | −135° | √2 (cos (−3π/4) + i sin (−3π/4)) |
| −i | 1 | −π/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 + 4i | 5 | 0.92729522 | 53.130102° | 5 (cos 0.92729522 + i sin 0.92729522) |
| −3 − 4i | 5 | −2.2142974 | −126.8699° | 5 (cos (−2.2142974) + i sin (−2.2142974)) |
Complex number calculator worked examples
| Problem | Result | How it works |
|---|---|---|
| (2 + 3i) + (4 − i) | 6 + 2i | Add real parts and imaginary parts separately. |
| (1/2 + 3/4i)(2 − i) | 7/4 + i | Multiply with i² = −1; the fractions stay exact. |
| (1 + i) ÷ (1 − i) | i | Multiply top and bottom by 1 + i; the bottom becomes 2. |
| i^27 | −i | 27 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)^8 | 16 | (1 + i)² = 2i, so (1 + i)⁸ = (2i)⁴ = 16. |
How to calculate with complex numbers
- 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.
- 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.
- 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.
- 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.
- 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 free tools
- Trig CalculatorSin, cos, tan, csc, sec and cot of any angle in degrees or radians, plus asin, acos and atan, with exact radical values for special angles.
- Matrix CalculatorAdd, subtract and multiply matrices up to 6×6, then find the determinant, inverse, rank, transpose and RREF in exact fractions, with the row steps shown.
- Quadratic Equation SolverSolve ax² + bx + c = 0 step by step: discriminant, exact and decimal roots (real or complex), vertex, factored form, completing the square and a graph.
- Scientific CalculatorFree online scientific calculator with live results: trig in DEG, RAD or GRAD, logs, powers, factorial, nPr, nCr, memory and history.
- System of Equations CalculatorSolve 2 or 3 linear equations exactly: row-reduction steps, determinant, Cramer’s rule and a graph. Finds one, no or infinitely many solutions.
- Half-Life CalculatorSolve for the remaining amount, initial amount, elapsed time or half-life, with decay constant and mean lifetime. Switch to doubling time for growth.
More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators