Complex Number Calculator (Add, Subtract, Multiply and Divide with Steps, Conjugate, Modulus and Complex Plane)
Enter the real and imaginary parts of the two complex numbers z₁ = a + bi and z₂ = c + di, and choose the operation (+ − × ÷). The expression below is linked to the input fields, so you can also edit the numbers directly in it.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Add, subtract, multiply or divide two complex numbers \(z_1 = a+bi\) and \(z_2 = c+di\) on the spot. Just enter the real and imaginary parts and choose the operation
- The answer is shown in \(a+bi\) form with fractions in lowest terms (exact values), such as \(\dfrac{11}{25} + \dfrac{2}{25}i\). For division, the steps show how multiplying by the complex conjugate of the denominator makes the denominator real. For multiplication, they show the expansion and how \(i^2\) is replaced with \(-1\)
- As a bonus, the complex conjugate \(\overline{z}\) and the absolute value \(|z|\) of the result are also shown. The absolute value is given as an exact value with the radical simplified, such as \(|3+4i| = 5\) or \(|1+i| = \sqrt{2}\)
- You can also see the result on the complex plane (Argand diagram), which shows at a glance where \(z_1\), \(z_2\) and the result lie
- The real and imaginary parts can be decimals, negative numbers or fractions such as 3/4
What is this calculation used for?
The alternating current (AC) in a wall outlet has a voltage and current that swing like waves, and different parts of a circuit shift the timing of the wave (the phase). In electrical engineering, the standard method is to combine this "size" and "shift" into one complex number (the impedance), so that a whole circuit can be solved with nothing more than complex arithmetic.
Complex calculations are part of every electrical engineering course and appear on engineering licensing exams such as the FE exam. Everywhere AC flows, from a phone charger to a power plant, the design relies on complex numbers.
Waves such as sound and radio can be broken down with the Fourier transform, a calculation that uses complex numbers, into "how much of each pitch (frequency) is in it". Phone networks (Wi-Fi, 5G), music compression, noise reduction and speech recognition all run huge numbers of these complex calculations inside.
The strength of complex numbers is that one number carries both the size and the timing of a wave, so in signal processing complex numbers are used even more than real numbers. The Fourier transform itself is college-level, but what happens inside it is the complex multiplication and addition taught in Algebra 2.
When designing machines that must damp out shaking and stay steady, such as autopilots, drones and robots, engineers check stability by looking at where the solutions (complex numbers) of the system's equation lie on the complex plane. If the real parts of the solutions are negative, the shaking dies down; if any is positive, it grows.
In this field, the positions of the solutions on the complex plane directly decide whether a machine can fly safely. Control engineering, which covers this stability test, is studied in college.
If you think of a point \((x,\ y)\) on the plane as the complex number \(x+yi\), multiplying by a complex number with absolute value 1 rotates the point around the origin. For example, multiplying by \(i\) rotates it by 90 degrees. This is exactly what 2D games need to turn characters or bullets.
Quaternions, used in 3D games and in phones to track their orientation, extend this idea of "rotation by complex numbers" to three dimensions.
A quadratic equation has no real solution when its discriminant \(D = b^2 - 4ac\) is negative. But once the number system is extended to the complex numbers, even \(x^2 = -1\) has the solutions \(x = \pm i\), and every quadratic or cubic equation has solutions (the fundamental theorem of algebra).
With no more "no solution" exceptions, not only mathematics but also the theories of physics and engineering are built on complex numbers. Complex arithmetic in Algebra 2 is the entry point.
Formulas and figures
Symbols and terms
Symbols
| \(i\) | i | The imaginary unit. It is defined as the number whose square is \(-1\) (\(i^2 = -1\)). The letter comes from "imaginary". (In electrical engineering, \(j\) is used instead, because \(i\) stands for current.) |
| \(z\) | z | The letter usually used for a complex number. By custom, \(z\) and \(w\) are used for complex numbers, to tell them apart from real variables \(x\) and \(y\). |
| \(z_1,\ z_2\) | z sub 1, z sub 2 | The first and second complex numbers. The small number at the lower right (the subscript) is just a label for "which one". It is not the same as an exponent, which is written at the upper right. |
| \(a,\ b,\ c,\ d\) | a, b, c, d | On this page, \(a\) is the real part and \(b\) the imaginary part of \(z_1 = a+bi\), and \(c\) is the real part and \(d\) the imaginary part of \(z_2 = c+di\). By custom, letters near the start of the alphabet stand for fixed numbers. |
| \(\overline{z}\) | z bar | The complex conjugate of \(z\). For \(z = a+bi\), it is \(a-bi\), with only the sign of the imaginary part changed. The bar on top marks "the partner". Some books write it as \(z^*\). |
| \(|z|\) | absolute value of z | The absolute value (modulus) of \(z\). It is the distance from the origin to \(z\) on the complex plane, calculated as \(|a+bi| = \sqrt{a^2+b^2}\). It is written with two vertical bars, the same as the absolute value of a real number. |
Terms
| complex number | A number of the form \(a+bi\), where \(a\) and \(b\) are real numbers. It is a larger number system that includes both real and imaginary numbers, and within it every quadratic equation has a solution. |
| imaginary number | A complex number that is not real, that is, \(a+bi\) with a nonzero imaginary part \(b\). (Some books use "imaginary number" only for pure imaginary numbers such as \(2i\).) Despite the name, these numbers are very useful in real calculations in electricity and physics. |
| imaginary unit | The number \(i\). It is defined by \(i^2 = -1\), and every imaginary number is written using \(i\). |
| real part | The \(a\) in \(a+bi\), the "real number part" of a complex number. On the complex plane, it is the coordinate along the horizontal axis (the real axis). |
| imaginary part | The \(b\) in \(a+bi\) (without the \(i\)). On the complex plane, it is the coordinate along the vertical axis (the imaginary axis). For example, the imaginary part of \(3-2i\) is \(-2\). |
| pure imaginary number | A complex number whose real part is 0 and whose imaginary part is not 0, such as \(2i\) or \(-3i\). On the complex plane, it lies on the imaginary axis. |
| complex conjugate | For \(a+bi\), the number \(a-bi\). Often just called "the conjugate". Its key property is that the product \((a+bi)(a-bi) = a^2+b^2\) is a real number that is 0 or more, which is why it is used to make the denominator real in division. |
| absolute value (modulus) | The distance \(\sqrt{a^2+b^2}\) from the origin on the complex plane. It extends the absolute value of a real number (its distance from 0 on the number line) to the plane. Also called the modulus. |
| complex plane | A plane with the real part on the horizontal axis and the imaginary part on the vertical axis, where \(a+bi\) is shown as the point \((a,\ b)\). A drawing of it is also called an Argand diagram. It is covered in detail in Precalculus, but this page uses it as a tool to make complex numbers "visible". |
| real axis | The horizontal axis of the complex plane, where the real numbers lie. A real number is a complex number with imaginary part 0, so it sits on the real axis. |
| imaginary axis | The vertical axis of the complex plane, where the pure imaginary numbers (complex numbers with real part 0, such as \(2i\)) lie. |
| making the denominator real | For a fraction with a complex denominator, multiplying the numerator and the denominator by the conjugate of the denominator so that the denominator becomes real. It is the complex-number version of rationalizing the denominator (removing a square root from the denominator). |
| expanding | Removing the parentheses from an expression and writing it as a sum or difference of terms. As in \((a+b)(c+d) = ac+ad+bc+bd\), each term in one set of parentheses is multiplied by every term in the other. |
| like terms | Terms with the same variable part. When adding or subtracting complex numbers, the terms with \(i\) (the imaginary part) and the terms without \(i\) (the real part) are each combined as like terms. |
| discriminant | The expression \(D = b^2-4ac\), which tells what kind of solutions the quadratic equation \(ax^2+bx+c=0\) has. When \(D < 0\) there is no real solution, but there are complex solutions \(x = \dfrac{-b \pm \sqrt{-D}\,i}{2a}\). This is usually where students first meet complex numbers. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Expanding expressions and like terms (Algebra 1, Grades 8–9) |
|
| Square roots and radicals (Grades 8–9) |
|
| Rationalizing the denominator (Algebra 1 and 2) |
|
| The coordinate plane and the Pythagorean theorem (Grades 6–8) |
|
| Quadratic equations and the discriminant (Algebra 1 and 2) |
|
| Working with fractions (Grades 5–7) |
|
How to calculate it in Excel
| Real part a of z₁ | 1 |
| Imaginary part b of z₁ | 2 |
| Real part c of z₂ | 3 |
| Imaginary part d of z₂ | 4 |
| Complex number z₁ | =COMPLEX(B1,B2) |
| Complex number z₂ | =COMPLEX(B3,B4) |
| Sum z₁ + z₂ | =IMSUM(B5,B6) |
| Difference z₁ − z₂ | =IMSUB(B5,B6) |
| Product z₁ × z₂ | =IMPRODUCT(B5,B6) |
| Quotient z₁ ÷ z₂ | =IMDIV(B5,B6) |
| Real part a | 3 |
| Imaginary part b | 4 |
| Complex number z | =COMPLEX(B1,B2) |
| Complex conjugate | =IMCONJUGATE(B3) |
| Absolute value |z| | =IMABS(B3) |
| Real part a of z₁ | 1 |
| Imaginary part b of z₁ | 2 |
| Real part c of z₂ | 3 |
| Imaginary part d of z₂ | 4 |
| Denominator c²+d² | =B3^2+B4^2 |
| Real part of quotient (ac+bd)÷(c²+d²) | =(B1*B3+B2*B4)/B5 |
| Imaginary part of quotient (bc−ad)÷(c²+d²) | =(B2*B3-B1*B4)/B5 |
The first table uses z₁ = 1+2i and z₂ = 3+4i. The sum shows "4+6i", the difference "-2-2i", the product "-5+10i" and the quotient "0.44+0.08i" (these results are text, not numbers).
The second table uses z = 3+4i. The complex conjugate is "3-4i" and the absolute value is 5 (only IMABS returns an ordinary number).
The third table checks division without the complex-number functions, following the conjugate formula directly. The real part of the quotient is 0.44 (= 11/25) and the imaginary part is 0.08 (= 2/25), which match the IMDIV result. "^" is a power, "*" is multiplication and "/" is division.
How to calculate it in Google Sheets
| Real part a of z₁ | 1 |
| Imaginary part b of z₁ | 2 |
| Real part c of z₂ | 3 |
| Imaginary part d of z₂ | 4 |
| Complex number z₁ | =COMPLEX(B1,B2) |
| Complex number z₂ | =COMPLEX(B3,B4) |
| Sum z₁ + z₂ | =IMSUM(B5,B6) |
| Difference z₁ − z₂ | =IMSUB(B5,B6) |
| Product z₁ × z₂ | =IMPRODUCT(B5,B6) |
| Quotient z₁ ÷ z₂ | =IMDIV(B5,B6) |
| Real part a | 3 |
| Imaginary part b | 4 |
| Complex number z | =COMPLEX(B1,B2) |
| Complex conjugate | =IMCONJUGATE(B3) |
| Absolute value |z| | =IMABS(B3) |
| Real part a of z₁ | 1 |
| Imaginary part b of z₁ | 2 |
| Real part c of z₂ | 3 |
| Imaginary part d of z₂ | 4 |
| Denominator c²+d² | =B3^2+B4^2 |
| Real part of quotient (ac+bd)÷(c²+d²) | =(B1*B3+B2*B4)/B5 |
| Imaginary part of quotient (bc−ad)÷(c²+d²) | =(B2*B3-B1*B4)/B5 |
How to calculate it in Python
from fractions import Fraction
import math
# Real and imaginary parts of z1 = a + bi and z2 = c + di (a fraction such as 3/4 can be written Fraction(3, 4))
z1_real, z1_imag = Fraction(1), Fraction(2)
z2_real, z2_imag = Fraction(3), Fraction(4)
# Sum and difference: combine the real parts and the imaginary parts separately
add_real, add_imag = z1_real + z2_real, z1_imag + z2_imag
sub_real, sub_imag = z1_real - z2_real, z1_imag - z2_imag
# Product: the formula (ac-bd) + (ad+bc)i, from expanding and substituting i^2 = -1
mul_real = z1_real * z2_real - z1_imag * z2_imag
mul_imag = z1_real * z2_imag + z1_imag * z2_real
# Quotient: multiply by the conjugate. The denominator becomes the real number c^2 + d^2
denominator = z2_real ** 2 + z2_imag ** 2
div_real = (z1_real * z2_real + z1_imag * z2_imag) / denominator
div_imag = (z1_imag * z2_real - z1_real * z2_imag) / denominator
# Absolute value of the quotient: square root of (real part squared + imaginary part squared)
abs_squared = div_real ** 2 + div_imag ** 2
abs_value = math.sqrt(abs_squared)
# Format as a+bi (when the imaginary part is negative, show it as a subtraction, such as -2 - 2i)
def to_complex_str(real, imag):
sign = "-" if imag < 0 else "+"
return f"{real} {sign} {abs(imag)}i"
print(f"Sum: {to_complex_str(add_real, add_imag)}")
print(f"Difference: {to_complex_str(sub_real, sub_imag)}")
print(f"Product: {to_complex_str(mul_real, mul_imag)}")
print(f"Quotient: {to_complex_str(div_real, div_imag)}")
print(f"Absolute value of the quotient, squared (fraction): {abs_squared}")
print(f"Absolute value of the quotient (decimal): {abs_value}")
How to write it in LaTeX and other math languages (copy and paste)
(a+bi) + (c+di) = (a+c) + (b+d)i
(a+bi) + (c+di) = (a+c) + (b+d)i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mi>i</mi><mo>)</mo>
<mo>+</mo>
<mo>(</mo><mi>c</mi><mo>+</mo><mi>d</mi><mi>i</mi><mo>)</mo>
<mo>=</mo>
<mo>(</mo><mi>a</mi><mo>+</mo><mi>c</mi><mo>)</mo>
<mo>+</mo>
<mo>(</mo><mi>b</mi><mo>+</mo><mi>d</mi><mo>)</mo><mi>i</mi>
</mrow>
</math>
(a+bi) + (c+di) = (a+c) + (b+d)i
ComplexExpand[(a + b I) + (c + d I)]
evalc((a + b*I) + (c + d*I));
z = (a + b*1i) + (c + d*1i);
(a+bi)+(c+di)=(a+c)+(b+d)i
(a+bi)(c+di) = (ac−bd) + (ad+bc)i
(a+bi)(c+di) = (ac-bd) + (ad+bc)i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mi>i</mi><mo>)</mo>
<mo>(</mo><mi>c</mi><mo>+</mo><mi>d</mi><mi>i</mi><mo>)</mo>
<mo>=</mo>
<mo>(</mo><mi>a</mi><mi>c</mi><mo>−</mo><mi>b</mi><mi>d</mi><mo>)</mo>
<mo>+</mo>
<mo>(</mo><mi>a</mi><mi>d</mi><mo>+</mo><mi>b</mi><mi>c</mi><mo>)</mo><mi>i</mi>
</mrow>
</math>
(a+bi)(c+di) = (ac-bd) + (ad+bc)i
ComplexExpand[(a + b I) (c + d I)]
evalc((a + b*I) * (c + d*I));
z = (a + b*1i) * (c + d*1i);
(a+bi)(c+di)=(ac-bd)+(ad+bc)i
(a+bi)/(c+di) = (ac+bd)/(c²+d²) + {(bc−ad)/(c²+d²)}i
\frac{a+bi}{c+di} = \frac{ac+bd}{c^{2}+d^{2}} + \frac{bc-ad}{c^{2}+d^{2}}\,i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mfrac>
<mrow><mi>a</mi><mo>+</mo><mi>b</mi><mi>i</mi></mrow>
<mrow><mi>c</mi><mo>+</mo><mi>d</mi><mi>i</mi></mrow>
</mfrac>
<mo>=</mo>
<mfrac>
<mrow><mi>a</mi><mi>c</mi><mo>+</mo><mi>b</mi><mi>d</mi></mrow>
<mrow><msup><mi>c</mi><mn>2</mn></msup><mo>+</mo><msup><mi>d</mi><mn>2</mn></msup></mrow>
</mfrac>
<mo>+</mo>
<mfrac>
<mrow><mi>b</mi><mi>c</mi><mo>−</mo><mi>a</mi><mi>d</mi></mrow>
<mrow><msup><mi>c</mi><mn>2</mn></msup><mo>+</mo><msup><mi>d</mi><mn>2</mn></msup></mrow>
</mfrac>
<mi>i</mi>
</mrow>
</math>
(a+bi)/(c+di) = (ac+bd)/(c^2+d^2) + ((bc-ad)/(c^2+d^2))i
ComplexExpand[(a + b I)/(c + d I)]
evalc((a + b*I) / (c + d*I));
z = (a + b*1i) / (c + d*1i);
(a+bi)/(c+di)=(ac+bd)/(c^2+d^2)+((bc-ad)/(c^2+d^2))i
|a+bi| = √(a²+b²)
\lvert a+bi \rvert = \sqrt{a^{2}+b^{2}}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>|</mo><mi>a</mi><mo>+</mo><mi>b</mi><mi>i</mi><mo>|</mo>
<mo>=</mo>
<msqrt>
<mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow>
</msqrt>
</mrow>
</math>
|a+bi| = sqrt(a^2+b^2)
ComplexExpand[Abs[a + b I]]
abs(a + b*I);
r = abs(a + b*1i);
|a+bi| = √(a^2+b^2)
How to have ChatGPT do the calculation
You are a math calculation assistant for complex numbers. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). For the two complex numbers z1 = 1 + 2i and z2 = 3 + 4i, show each of the following: 1. The sum z1 + z2, the difference z1 − z2 and the product z1 × z2 (in a+bi form) 2. The quotient z1 ÷ z2 (in a+bi form with fractions in lowest terms, with the steps of multiplying by the conjugate of the denominator) 3. The complex conjugate and the absolute value of the quotient (the absolute value both as an exact value with the radical simplified and as a decimal) In Python, use the fractions module from the standard library to calculate the real and imaginary parts exactly, and show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
