Complex number power calculator
(1 + i)² is 2i: enter the real and imaginary parts and a whole exponent, and get the power in a + bi form with the modulus and angle behind it, no long multiplication needed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Real
- 1
- Imag
- 1
- N
- 2
- Modulus
- 1.4142135624
- Argument
- 0.7853981634
- Result real
- 0
- Result imag
- 2
Raising a complex number to an integer power is a standard task in algebra, trigonometry, and engineering phasor work. Writing (a+bi)^n by repeated multiplication is slow and error-prone once the exponent grows, and binomial expansion of (a+bi)^n for large n is tedious by hand. De Moivre's theorem converts the base to polar form, multiplies the argument by n, raises the modulus to n, and converts back to rectangular coordinates in a fixed number of steps. This complex number power calculator accepts the real and imaginary parts of z and an integer exponent n, applies De Moivre deterministically, and returns the rectangular result plus intermediate modulus and argument so students, tutors, and automation scripts can verify every step. Zero base is handled carefully: positive powers yield zero, while 0^0 and negative powers of zero fail as invalid input.
De Moivre theorem and the polar path to z^n
Any non-zero complex number z equals a plus b times i can be written in polar form as z equals r times the sum of cos theta and i sin theta, where r is the modulus sqrt of a squared plus b squared and theta is the principal argument given by atan2 of b and a. De Moivre's theorem states that for every integer n the power z to the n equals r to the n times cos of n theta plus i sin of n theta.
That identity is the entire algorithm: compute r and theta once, scale the radius by the power and the angle by the exponent, then expand with cosine and sine to recover the rectangular parts. Positive n stretches or shrinks the vector and rotates it n times around the origin. Negative n is the reciprocal power: r becomes one over r to the absolute value of n and the angle reverses sign, which is exactly what you need for 1 over z to the k.
The zero exponent always returns one plus zero i for any non-zero base, matching the algebraic identity z to the zero equals one.
Where complex powers come in handy
Classrooms and tutoring platforms use a complex number power calculator so learners can check (a+bi)^n without expanding binomials by hand or losing a sign in the rotation. Exam-prep generators need a deterministic oracle that treats 0^0 and negative powers of zero as hard failures instead of silent NaNs that a buggy grader might accept. Keep requests small, pin the rounded rectangular parts in tests, and you get reproducible powers for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.
What you can do with it
Classroom and homework checks
Let students submit a, b, and integer n for (a+bi)^n and verify rectangular results against De Moivre steps without hand multiplication errors.
Exam and LMS auto-grading
Mark complex power items with a deterministic oracle that rejects 0^0 and zero to a negative power as invalid, never inventing a rectangular answer.
Phasor and signal notebooks
Raise engineering phasors a+bi to integer stage powers in scripts without importing a full computer-algebra library.
FAQ
How do I raise a complex number to an integer power?
Send finite numbers real and imag for z=a+bi, plus integer n.
What is De Moivre's theorem in this calculator?
For z = r(cos θ + i sin θ) and integer n, z^n = r^n (cos(nθ) + i sin(nθ)).
Can n be a fraction or a complex exponent?
No. This capability requires a finite integer n.
What happens with a negative exponent?
You get the reciprocal power: the modulus becomes one over r raised to the size of the exponent, and the angle turns the other way. That is exactly what you need for 1 over z to a power.
What is a complex number to the power 0?
It is 1 for any nonzero number, as in ordinary algebra. For zero itself, 0 to the power 0 and negative powers are refused, because the first is undefined and the second would divide by zero.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/complex-power \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"real":1,"imag":1,"n":2}'const res = await fetch("https://api.kit.forhosting.com/algebra/complex-power", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"real": 1,
"imag": 1,
"n": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/complex-power",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"real": 1,
"imag": 1,
"n": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/complex-power", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"real":1,"imag":1,"n":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"real":1,"imag":1,"n":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/complex-power", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"real": 1,
"imag": 1,
"n": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.complex_power",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Input contract, response shape, and edge cases
The exponent n must be an integer: fractional powers would require multi-valued complex roots, which are outside this single-valued De Moivre integer-power contract, so a non-integer n is rejected. When the base is the complex zero, n greater than zero returns result real and result imag both zero; n equal to zero fails because zero to the zero is undefined; n less than zero fails because that would divide by zero. Example: real one, imag one, n two yields modulus sqrt two, argument pi over four, and rectangular result zero plus two i, matching (1+i)^2 equals 2i. POST a JSON body with three required finite numbers: real, the real part a of the base; imag, the imaginary part b; and n, the integer exponent. Each field may arrive as a JSON number or as a numeric string; missing fields, empty strings, and non-finite values fail with invalid_input naming the field. Absolute values of n larger than one million are also rejected to keep results finite in IEEE floating point. On success the body echoes real, imag, and n; reports modulus r and argument theta in radians; gives result_real and result_imag rounded to twelve decimal places for stable goldens; includes a rectangular display string; and restates the De Moivre formula. Failed validation is not billed; successful calls use the published $0.002 base price.
Where a complex power API earns its keep
Electrical engineering notebooks raise phasors to integer powers when modeling repeated stage gains, filter poles, or discrete Fourier steps; calling a tiny parse API avoids pulling a full computer-algebra system for three coefficients and one integer.
Technical questions
What happens for 0^0 or zero to a negative power?
Both cases fail with invalid_input. Zero to a positive power returns 0+0i. Non-zero bases with n=0 return 1+0i.
What does the complex number power calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.