Complex Square Root Calculator
The square roots of 3 + 4i are 2 + i and −2 − i: enter the real and imaginary parts and get the principal root and its counterpart in rectangular form, ready to use. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
This complex square root calculator accepts a number in rectangular form, using separate real and imaginary parts, and returns the two values whose squares equal that number. The first result is the principal square root, chosen with a nonnegative real part and the standard branch convention. The second is its negative counterpart. The calculation is deterministic, works for purely real and purely imaginary inputs as well as general complex numbers, and keeps every result in rectangular form for immediate use in algebra, engineering, or software.
Enter a complex number in rectangular form
Write the number as a + bi, then place a in the real field and b in the imaginary field. For example, 3 + 4i is entered with real equal to 3 and imaginary equal to 4. A negative imaginary component is entered directly, so 8 - 6i uses 8 and -6.
The calculator accepts finite decimal values, including integers and zero, but rejects text, infinity, and values that are not numbers. You do not need to convert the input to polar form or calculate its argument first. The result remains rectangular, which makes it easy to substitute into an equation or pass to another calculation without an extra trigonometric conversion.
If the input lies on the real axis, use zero for the imaginary field; this also makes the chosen branch unambiguous and documents the complete complex value you intend to solve.
Understand the principal root and its counterpart
Every nonzero complex number has exactly two square roots, and they are negatives of one another. This calculator labels one result principal and the other counterpart. The principal root follows the conventional branch: its real component is nonnegative, and when the real component is zero on the negative real axis, its imaginary component is nonnegative.
The counterpart is produced by negating both rectangular components of the principal result. Squaring either result therefore returns the original input, apart from the ordinary rounding limits of floating-point arithmetic. For 3 + 4i, the principal root is 2 + i and the counterpart is -2 - i.
For a negative real input such as -9 + 0i, the principal root is 0 + 3i and the other root is 0 - 3i.
Use and verify the rectangular results
A rectangular result u + vi can be checked without any complex-number library. Square it using (u squared minus v squared) + (2uv)i, then compare those two components with the original real and imaginary inputs. Small differences in the last decimal places can appear because JavaScript numbers use finite binary floating-point precision, especially for irrational roots.
The algorithm uses the complex magnitude and a numerically stable branch choice, avoiding unnecessary angle calculations and reducing cancellation in common cases. Keep full returned precision through intermediate work and round only when presenting a final measurement. Invalid values produce an input error instead of a plausible-looking result, allowing a calling workflow to correct its data before continuing.
What you can do with it
Solve quadratic equations over complex numbers
Compute the two rectangular roots needed when a discriminant or isolated squared variable is complex.
Check engineering calculations
Convert a complex square root into explicit real and imaginary components for circuits, waves, and control-system work.
FAQ
Why are there two answers?
If w squared equals z, then the square of -w also equals z. The calculator returns the principal root first and its negative counterpart second.
How is the principal square root selected?
It uses the standard branch with a nonnegative real component; on the negative real axis, the principal root has a nonnegative imaginary component.
Can I calculate the square root of a negative real number?
Yes. Enter the negative value as the real part and zero as the imaginary part. For example, -9 + 0i returns 0 + 3i as the principal root.
Why do some results contain long decimals?
Many complex roots are irrational, and computation uses finite floating-point numbers. Keep the returned precision during further calculations and round only for display.
How can I check a complex square root by hand?
Square the root u + vi as (u² − v²) + (2uv)i and compare it with the original number. For 2 + i, that gives 4 − 1 = 3 and 2 · 2 · 1 = 4, so you get 3 + 4i back.
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-square-root \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"real":3,"imaginary":4}'const res = await fetch("https://api.kit.forhosting.com/algebra/complex-square-root", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"real": 3,
"imaginary": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/complex-square-root",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"real": 3,
"imaginary": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/complex-square-root", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"real":3,"imaginary":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"real":3,"imaginary":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/complex-square-root", 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": 3,
"imaginary": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.complex_square_root",
"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
Enter a complex number in rectangular form
Both fields are required because an omitted component is different from an explicitly supplied zero in an API contract.
Understand the principal root and its counterpart
Zero is the special case where the two mathematical roots coincide; both returned objects contain zero components so the response shape remains consistent for clients.
Use and verify the rectangular results
That makes the output suitable for equation solvers, signal-processing worksheets, electrical calculations, educational tools, and application code that needs a predictable JSON structure. For automated use, each request costs $0.002; the same fixed computation has no network dependency, random choice, or time-dependent behavior.
Integration use cases
Build deterministic math workflows
Return a stable JSON pair that software can consume without implementing branch conventions separately.
Technical questions
What does an API calculation cost?
Each API request costs $0.002. The calculation is also designed to run as a free browser-side tier-A capability.