Complex Number Calculator
Type both numbers as a + bi, pick an operation, and the answer arrives with its polar form beside it. The page opens on (3 + 4i) / (1 - 2i), which is -1 + 2i, modulus 2.2361, argument 116.565 degrees, polar form 2.2361 cis 116.565°. Under the answer the working is printed line by line, so a division shows the conjugate it multiplied by and a square root shows both roots rather than one. Two things most calculators get wrong are right here: the argument is the principal value from atan2, so -1 - i comes back as -135 degrees rather than 45, and the division scales on the larger part of the denominator first, so 1 / (1e200 + 1e200i) is 5e-201 - 5e-201i where the textbook conjugate form overflows and prints 0. Angles switch between degrees and radians, i and j are both read, nothing is gated and there is no sign-up.
- Angles in
Multiply above and below by the conjugate, scaled on the larger part of the denominator so a large one does not overflow. Write a number as 3 + 4i, 4i, -i, 7 or 3 + 4j, with brackets around the whole number if you like.
- Result
- Modulus
- Argument
- Polar
The working
Every line is the arithmetic that produced the answer above, in the order it ran.
- (3 + 4i) / (1 - 2i) = ((3 + 4i)(1 + 2i)) / ((1 - 2i)(1 + 2i))Multiply above and below by the conjugate of the denominator, 1 + 2i. That clears i from underneath without changing the value.
- = (-5 + 10i) / 5 = -1 + 2iUnderneath, 1² + (-2)² = 5, a real number, so each part can be divided on its own.
- |-2| is the larger part of the denominator, so the working divides through by it: 1 / -2 = -0.5Scaling on the larger part keeps every intermediate value within a factor of two of a number already here, so a denominator near 1.8e308 does not overflow on the way to the answer.
- |-1 + 2i| = sqrt((-1)² + 2²) = sqrt(5) = 2.2361The modulus is the distance from 0, measured with hypot so that squaring a large part cannot overflow.
- arg(-1 + 2i) = atan2(2, -1) = 116.565°atan2 keeps the quadrant that dividing the parts would lose. This is the principal value, over -180 degrees and up to 180.
- -1 + 2i = 2.2361 cis 116.565° = 2.2361e^(2.03444i)cis is short for cos + i sin. The exponent is in radians whatever unit the argument is shown in, because that is the only unit the exponential form is true in.
Three cases, worked
Each line below is computed by the same code that answers the calculator above, so the examples and the tool can never disagree.
Common questions
- How do I calculate with complex numbers on this page?
- Type the first number into A as a + bi, choose the operation, and type the second number into B when the operation needs one. The answer appears as you type, with its modulus, argument and polar form in the cells under it and the working below that. Add, subtract, multiply and divide take two numbers; polar form, conjugate and square root take A alone, and the B field steps out of the way. Nothing is gated, there is no sign-up, and the Copy button hands over the answer, its polar form and every line of the working.
- How do you divide complex numbers?
- Multiply above and below by the conjugate of the denominator, which turns the bottom into a real number, then divide each part by it. For (3 + 4i) / (1 - 2i) the conjugate is 1 + 2i, the top becomes -5 + 10i, the bottom becomes 1² + (-2)² = 5, and the answer is -1 + 2i. The page prints exactly those lines. Underneath it does the arithmetic in a different order, dividing through by the larger part of the denominator first, because squaring the parts overflows a double once they pass about 1.3e154: 1 / (1e200 + 1e200i) really is 5e-201 - 5e-201i, and the textbook order hands back 0. A denominator of 0 is refused by name, because dividing by it has no answer.
- What is the argument of a complex number, and which one does this give?
- The argument is the angle from the positive real axis round to the line joining 0 to the number. Every complex number has infinitely many of them, a full turn apart, so a calculator has to choose. This one returns the principal value from atan2: over -180 degrees and up to 180, with the negative real axis at +180 rather than -180. That is what keeps the quadrant honest. -1 - i is -135 degrees here, where a calculator built on atan(b/a) says 45. Switch Angles to Radians and (3 + 4i) / (1 - 2i) reads 2.03444 rad instead of 116.565 degrees. Zero is the one number with no argument at all, and the page says so rather than printing 0.
- How do I convert a complex number to polar form?
- Choose Polar form of A and type the number. 5 + 12i comes back as modulus 13, argument 67.38 degrees and polar form 13 cis 67.38°. cis is short for cos + i sin, so 13 cis 67.38° means 13(cos 67.38° + i sin 67.38°). The working also prints the exponential form, 13e^(1.17601i), and that exponent is in radians whatever unit is on screen, because radians is the only unit the exponential form is true in. The modulus and argument are shown for every operation, not only this one, so a division tells you its polar form too.
- What is the square root of a negative number, and why are there two?
- Square root of A with -4 typed in gives 2i, and -2i is printed beside it. Both of them square to -4, and that is true of every number except 0: the two roots are the same length and half a turn apart. The one shown first is the principal root, the one whose argument is over -90 degrees and up to 90, which for -4 means +2i rather than -2i. Numbers that are not real work the same way, and often come out clean: the square root of 3 + 4i is exactly 2 + i.
- Which ways of writing a + bi does it read?
- 3 + 4i, 3+4i, 4i + 3, -i, 7, .5 + .25i, 1e3 + 2.5e-2i and 3 + i4 are all read, and terms repeated in one entry are summed, so 1 + 2i + 3 + 4i is 4 + 6i. Engineers can write j instead of i. Brackets around the whole number are fine, as in (3 + 4i), and the minus sign a spreadsheet pastes is read as a minus rather than refused. What it will not read, it refuses by name: a stray letter is quoted back at you, two numbers run together are told to take a + or a - between them, and an entry longer than 120 characters is refused rather than quietly cut short.
- Is the arithmetic exact?
- The four operations are done straight on the parts you type, with no iteration and no approximation step, so (1 + i)(1 - i) is 2 and i times i is -1 on the nose. Answers are printed to 12 significant figures, which is where the last-bit noise of binary floating point falls off: 0.1 + 0.2 prints here as 0.3 rather than 0.30000000000000004. The modulus and the argument come from hypot and atan2 and are rounded for the screen, to four decimal places and, in degrees, to three; a figure too small to show at those places keeps twelve significant figures instead of rounding away to zero, so the modulus of 1 divided by 1e200 + 1e200i reads 7.07106781187e-201. This is a numeric calculator rather than a symbolic one, so 1 divided by 3 reads 0.333333333333 and not a third.
Exact complex arithmetic. Division scales on the larger part of the denominator first, so an operand near the floating-point limit does not overflow on the way to a correct answer. The argument is the principal value, in the angle unit you pick, and the square root shown is the principal one with the second root printed next to it rather than hidden.