a+bi form converter
Enter 3 and 4 and you get 3+4i, a modulus of 5 and an argument of 53.130102 degrees, or 0.927295 radians. The rectangular and polar forms appear together, with the angle placed in the right quadrant. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 3
- Bi
- 4
- Rectangular
- 3+4i
- Modulus
- 5
- Argument rad
- 0.927295
- Argument deg
- 53.130102
The a+bi form converter takes the real part a and the imaginary part bi of a complex number and returns both of its standard representations in a single call: the rectangular a+bi form, correctly signed and simplified, and the polar form with the modulus r and the argument theta given in both radians and degrees. It is the conversion every student of algebra and every engineer working with phasors, impedances or signals does by hand, done deterministically and without rounding surprises. The same code that runs on our edge runs free in your browser on this page.
Two names for the same number
A complex number is a point in the plane, and like every point it can be named in two ways. The rectangular form a+bi says how far to move along the real axis and how far along the imaginary axis: 3+4i means three units right, four up. The polar form says how far the point is from the origin and at what angle: a modulus r and an argument theta, written r(cos theta + i sin theta).
Neither form is more correct than the other; they are convenient for different operations. Addition and subtraction are trivial in rectangular form and painful in polar form, while multiplication, division, powers and roots become simple in polar form because moduli multiply and arguments add. This converter gives you both representations from the two parts you already have, so you can pick the one that suits the next step of your calculation.
Send a and bi, and you receive the formatted a+bi string, the modulus, and the argument in radians and degrees.
How the modulus and argument are computed
The modulus is the Euclidean distance from the origin, computed with a numerically stable hypotenuse so that very large or very small parts do not overflow or underflow the way a naive sqrt(a² + b²) can. The argument is computed with the two-argument arctangent, which looks at the signs of both parts and therefore places the angle in the correct quadrant: 1+i and -1-i have the same slope but opposite directions, and the result reflects that, with arguments of 45 and -135 degrees respectively.
The argument is always reported in the principal range from -180 to 180 degrees. The origin 0+0i is accepted and reported with an argument of 0 by convention, since its angle is mathematically undefined but a definite answer is more useful than an error for a perfectly valid complex number. All displayed values are rounded to the precision you request, six decimal places by default, so results are stable and comparable across machines.
Where the conversion shows up in practice
Electrical engineers live in this conversion: an impedance written as resistance plus reactance, like 30+40i ohms, becomes a magnitude of 50 ohms at a phase of about 53.13 degrees, which is what a meter actually reads. Signal processing code that multiplies spectra switches to polar form so that multiplication becomes an addition of phases and a product of magnitudes, then switches back to rectangular for the inverse transform.
Students use it to check homework on De Moivre's theorem, where raising a complex number to a power is a one-liner in polar form and a page of binomial expansion in rectangular form.
What you can do with it
Read an impedance as magnitude and phase
Turn resistance plus reactance, such as 30+40i ohms, into the 50-ohm magnitude and 53.13-degree phase a meter reports.
Check algebra homework
Verify the polar form needed for De Moivre powers and roots without redoing the arctangent quadrant logic by hand.
Preprocess values in a signal pipeline
Convert rectangular samples to magnitude and phase before multiplication, then back, with deterministic rounding.
FAQ
What do I send and what do I get back?
Send the real part a and the imaginary part bi. You get the rectangular a+bi string, the modulus r, the argument in radians and degrees, and the full polar expression.
Which quadrant does the angle fall in?
The correct one. The argument uses the two-argument arctangent, so the signs of both parts are respected and the result lies between -180 and 180 degrees.
What happens with 0+0i?
It is accepted: the modulus is 0 and the argument is reported as 0 by convention, since the angle of the origin is undefined.
Can I control the rounding?
Yes. The precision field sets the decimal places in the formatted output, from 0 to 12; it defaults to 6.
When should I use the polar form instead of a+bi?
Use a+bi for adding and subtracting, and the polar form for multiplying, dividing, powers and roots, because moduli multiply and arguments add. The converter gives both so you can pick the one for your next step.
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/math/a-bi-form \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"bi":4}'const res = await fetch("https://api.kit.forhosting.com/math/a-bi-form", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"bi": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/a-bi-form",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"bi": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/a-bi-form", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"bi":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"bi":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/a-bi-form", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 3,
"bi": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.a_bi_form",
"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
Where the conversion shows up in practice
The endpoint runs as a pure function with no storage and no network calls: your numbers are converted and discarded. It costs $0.002 per request through the API, and the interactive version on this page runs the identical code free of charge, which makes it easy to verify a result by hand before you wire the call into a pipeline.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page, with the identical code.
What is rejected as invalid?
Any real or imaginary part that is missing or not a finite number — NaN, Infinity or a non-numeric value returns an invalid_input error and is not billed.