ForHosting KIT · Math

Multiply complex numbers

Multiply two complex numbers in rectangular form: (1 + 2i)(3 + 4i) gives −5 + 10i, using (ac − bd) + (ad + bc)i with i² replaced by −1. Enter the real and imaginary parts of each factor. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A real
1
A imag
2
B real
3
B imag
4
You get
Product real
-5
Product imag
10
A rectangular
1+2i
B rectangular
3+4i

Multiplying two complex numbers is a core algebra skill that shows up in homework, electrical-engineering phasors, and signal-processing notebooks. Given z1 = a + bi and z2 = c + di, the rectangular product is (ac − bd) + (ad + bc)i. Expanding by FOIL and replacing i squared with negative one is the entire algorithm: four real multiplications and two additions, with a sign flip on the real part from the i squared term. This multiply-complex-numbers calculator accepts the real and imaginary parts of both factors as finite numbers, applies that identity deterministically, and returns the rectangular product so students, tutors, and automation scripts can check every FOIL step.

FOIL, i squared, and the rectangular product identity

Two complex numbers multiply by the same distributive law as binomials over the reals, with one extra identity: i squared equals negative one. Write the factors as a plus b i and c plus d i. Expanding FOIL produces four real products: a times c, a times d i, b i times c, and b i times d i.

The last term contains i squared, which is replaced by negative one, so b d i squared becomes negative b d and lands on the real axis. Collecting like terms then yields the closed rectangular formula (a c minus b d) plus (a d plus b c) i. That identity is the entire algorithm this calculator runs: four multiplications and two additions, with a sign flip on the real part from the i squared term.

There is no conversion to polar form, no argument, and no De Moivre rotation — those belong to a complex-power or rectangular-to-polar tool. Multiplication of two rectangular numbers stays in the plane as a scaled rotation, but you never need the polar intermediates to compute the product. When one factor is real, with imaginary part zero, the formula reduces to ordinary scaling of both parts of the other factor.

When the factors are conjugates a plus b i and a minus b i, the imaginary cross terms cancel and the product is the real number a squared plus b squared, which is the squared modulus. Zero times anything is zero. Negative parts are first-class: signs propagate through the four products exactly as they would on paper.

The capability returns the rectangular factors and the rectangular product so a classroom demo can pin both the FOIL expansion and the final a plus b i string without recomputing ac minus bd by hand.

Where a multiply-complex-numbers calculator earns its keep

Classrooms and tutoring platforms use a multiply-complex-numbers calculator so learners can check FOIL homework without losing the i squared sign that turns the last term real. Exam-prep generators need a deterministic oracle that treats non-finite parts as hard failures instead of silent NaNs that a buggy grader might accept as a product. Computer-graphics and signal-processing scripts treat a plus b i as a two-dimensional similarity (scale and rotate) and multiply two of them to compose transforms.

Failed validation does not consume balance. Keep requests small, pin the rounded rectangular parts in tests, and you get reproducible products for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own. This landing answers the two-factor product query; it is not a De Moivre integer-power tool and it is not a rectangular-to-polar converter.

Distinct search intent from those neighbours is the reason this page exists as its own calculator rather than a mode on a general complex toolbox.

Phasor and transform notebooks

Multiply rectangular phasors or 2-D similarity transforms in scripts without importing a full computer-algebra library.

What is the formula for (a+bi)(c+di)?

Expand FOIL and replace i² with −1: (a+bi)(c+di) = (ac−bd)+(ad+bc)i. The formula field restates that identity on every success.

What happens if a part is missing or not a finite number?

Missing values, empty strings, non-numeric text, NaN, and Infinity are not billed.

Does this use polar form or De Moivre's theorem?

No. This calculator stays in rectangular form with four multiplies and two adds. Polar conversion and integer powers are separate tools.

What do I get when I multiply a complex number by its conjugate?

A real number. For a + bi times a − bi the imaginary cross terms cancel, and the product is a squared plus b squared, which is the squared modulus of the number.

How precise is the result?

The real and imaginary parts of the product are rounded to twelve decimal places, so the same factors always give the same digits and a result can be compared reliably with an answer key.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/multiply-complex-numbers

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/multiply-complex-numbers \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a_real":1,"a_imag":2,"b_real":3,"b_imag":4}'
{
  "a_real": 1,
  "a_imag": 2,
  "b_real": 3,
  "b_imag": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.multiply_complex_numbers",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Any part that is not a finite number fails with invalid_input and is not billed.

Input contract, response shape, and error behaviour

POST a JSON body with four required finite numbers: a_real and a_imag for the first factor z1 equals a_real plus a_imag times i, and b_real and b_imag for the second factor z2 equals b_real plus b_imag times i. Each field may arrive as a JSON number or as a numeric string. Common aliases are accepted when the canonical name is omitted: a, real1, or real_1 for a_real; b, imag1, or imag_1 for a_imag; c, real2, or real_2 for b_real; d, imag2, or imag_2 for b_imag. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not billed. On success the body echoes the four cleaned parts, returns product_real and product_imag as the primary rectangular result rounded to twelve decimal places for stable goldens, includes a_rectangular, b_rectangular, and product_rectangular display strings, and restates the FOIL identity in the formula field. Example: a_real one, a_imag two, b_real three, b_imag four yields product_real negative five and product_imag ten, matching (1+2i)(3+4i) equals negative five plus ten i because one times three minus two times four is negative five and one times four plus two times three is ten. Magnitude that overflows IEEE floating point into Infinity is rejected rather than returned as a non-finite product. Failed validation is not billed; successful calls use the published $0.002 base price. Pair the payload with your own labels or charts; this endpoint does not emit plots or multi-step classroom prose beyond the rectangular strings and the formula field.

Where a multiply-complex-numbers calculator earns its keep

Electrical engineering notebooks multiply rectangular phasors when combining impedances, stage gains, or discrete Fourier bins; calling a tiny parse API avoids pulling a full computer-algebra system for four coefficients.

Classroom and homework FOIL checks

Let students submit a, b, c, and d for (a+bi)(c+di) and verify product_real and product_imag against the textbook expansion, including the i-squared sign flip.

Exam and LMS auto-grading

Mark complex-product items with a deterministic oracle that rejects NaN and Infinity as invalid_input and never invents a rectangular answer.

How do I multiply two complex numbers?

Send finite numbers a_real and a_imag for z1=a+bi, plus b_real and b_imag for z2=c+di. The API returns product_real = ac−bd and product_imag = ad+bc.

What does the multiply-complex-numbers calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →