ForHosting KIT · Math

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
Use it from WebAPIEmailTelegramApp soon

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.

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.

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.

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/algebra/complex-square-root

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/algebra/complex-square-root \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"real":3,"imaginary":4}'
{
  "real": 3,
  "imaginary": 4
}
{
  "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.

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.

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.

Build deterministic math workflows

Return a stable JSON pair that software can consume without implementing branch conventions separately.

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.

Read the full KIT documentation →