Complex Numbers Calculator
Add, subtract, multiply and divide complex numbers, and move between rectangular z = a + jb and polar z = r∠θ form — the everyday arithmetic behind phasors, impedance and AC circuits.
Inputs
Result
Step-by-step working
Formula
- z = a + jb
- z = r∠θ
- |z| = sqrt(a² + b²)
- θ = atan2(b, a)
- a = r cos θ
- b = r sin θ
Rectangular form z = a + jb names the real part a and the imaginary part b; polar form z = r∠θ names the magnitude r and the phase θ. They are the same phasor described two ways, and the conversion runs r = sqrt(a² + b²) and θ = atan2(b, a) one way, a = r cos θ and b = r sin θ the other.
Addition and subtraction work part by part: (a + jb) + (c + jd) = (a + c) + j(b + d), and the same with the signs flipped for subtraction. Multiplication rotates and scales — (a + jb)(c + jd) = (ac - bd) + j(ad + bc) — and division scales by the denominator's magnitude squared while multiplying by its conjugate, (a + jb)/(c + jd) = [(ac + bd) + j(bc - ad)] / (c² + d²), which needs c² + d² to be greater than zero.
The phase uses atan2(b, a), never atan(b / a): atan sees only the ratio and would report a second-quadrant phasor as a fourth-quadrant one. atan2 reads the signs of both parts and returns an angle from -180° to +180° (-π to π in radians), so the quadrant is always right. Angles are shown in the unit selected above — degrees by default, because they are easier to read on a phasor diagram — and the phase of 0 + j0 is undefined, so it is reported as such rather than guessed.
About this calculation
A complex number carries two pieces of information at once, and impedance, phasors, transfer functions and AC power all use them. Written in rectangular form z = a + jb it is easy to add and subtract; written in polar form z = r∠θ it is easy to multiply and divide. The calculator does both, converting between the forms, and takes the angle from atan2 so the result lands in the correct quadrant.
Assumptions and limits
- The angle is measured anticlockwise from the positive real axis, in the quadrant the number actually occupies — not the ±90° a plain arctan would give.
- Arithmetic is ordinary double-precision floating point, so the last digit or two of a long division may differ slightly from a hand calculation.
- The magnitude r is always a real, non-negative length (r = √(a² + b²)), and 0 is the one value with an undefined angle.
A worked example
3 + j4 has magnitude √(3² + 4²) = 5 and phase atan2(4, 3) ≈ 53.13°, so it is also 5∠53.13° — the right-angled triangle every first-year engineering course draws.