ForHosting KIT · Math

Complex modulus calculator

The modulus of 3 + 4i is 5, its distance from the origin on the complex plane: enter the real and imaginary parts and get |z| and its square, never negative. 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
Real
3
Imag
4
You get
Complex
3+4i
Modulus
5
Squared modulus
25

The modulus of a complex number is its distance from the origin on the Argand plane: for z equals a plus b i, |z| equals the square root of a squared plus b squared. Students meet this formula when converting rectangular form to polar form, engineers use it for impedance magnitude and signal amplitude, and graphics or control code needs a fast, deterministic |z| without pulling a computer-algebra system. This complex modulus calculator accepts the real and imaginary parts, returns the modulus, the squared modulus, a compact display string for the complex number, and a short formula you can show next to the answer.

What the complex modulus means geometrically and algebraically

A complex number z equals real plus imag times i can be drawn as a point or vector in the plane with horizontal coordinate real and vertical coordinate imag. The modulus |z| is exactly the Euclidean length of that vector: the straight-line distance from the origin to the point (real, imag). Algebraically that length is the non-negative square root of real squared plus imag squared, which is also written |a+bi| equals sqrt of a squared plus b squared.

Because squares erase sign, the numbers three plus four i, negative three plus four i, three minus four i, and negative three minus four i all share the same modulus five. When either part is zero the formula collapses sensibly: a pure real number has modulus equal to its absolute value, and a pure imaginary number bi has modulus equal to the absolute value of b. The zero complex number zero plus zero i has modulus zero and lies at the origin.

The modulus is never negative; it is zero only at the origin. In polar form z equals r times e to the i theta, the radius r is precisely this modulus, so computing |z| is the first step of rectangular-to-polar conversion.

Where the modulus of a complex number helps

Classrooms and tutoring platforms use a complex modulus calculator so learners can check |a+bi| for arbitrary coefficients without calculator-mode mistakes on signs or order of operations. Exam generators and LMS plugins need a deterministic oracle that rejects non-finite junk and never invents a negative length. Electrical engineering notebooks reduce impedance magnitude, phasor amplitude, and filter gain checks to a single |z| call when a full CAS would be overkill.

Signal-processing and control scripts compare energy or amplitude via the squared modulus without standing up heavy numeric libraries on the edge. Failed validation does not consume balance. Keep requests small, pin the rounded modulus in tests, and you get reproducible magnitudes for homework, LMS plugins, and edge workers without importing symbolic math infrastructure of your own.

Classroom and homework checks

Let students submit real and imag for z=a+bi and verify |z| against textbook Pythagorean or polar-form methods.

Exam and LMS auto-grading

Mark complex modulus items with a deterministic oracle that returns the non-negative sqrt(a²+b²) and rejects non-finite input.

Engineering notebooks and phasors

Compute impedance magnitude or signal amplitude |a+bi| in scripts without pulling a full computer-algebra library.

How do I compute the modulus of a complex number?

Send finite numbers real and imag for z = real + imag·i.

Is the modulus the same as the absolute value of a complex number?

Yes. |z|, modulus, magnitude, and absolute value of a complex number all mean the non-negative distance from the origin in the complex plane.

What if the imaginary part is zero?

Then z is a pure real number and |z| equals the ordinary absolute value of the real part. Pure imaginary numbers are handled the same way on the imag axis.

Does this calculator return the argument (angle)?

No. This capability returns only the modulus and related magnitude fields. Use a complex argument or polar-form tool if you also need the angle.

Why do 3 + 4i and −3 − 4i have the same modulus?

Squaring erases the signs, so 3 + 4i, −3 + 4i, 3 − 4i and −3 − 4i all have modulus 5. They are four points at the same distance from the origin, in different directions.

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-modulus

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-modulus \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"real":3,"imag":4}'
{
  "real": 3,
  "imag": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.complex_modulus",
  "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.

What the complex modulus means geometrically and algebraically

This endpoint focuses on that magnitude step and does not return the argument angle; pair it with an argument calculator if you need the full polar pair.

Input contract, response shape, and validation behaviour

Classic check: real equals three and imag equals four yields modulus five and squared modulus twenty-five, matching the Pythagorean triple. Real equals zero and imag equals negative seven yields modulus seven with complex string negative seven i. POST a JSON body with two required finite numbers: real, the real part of z, and imag, the imaginary part. Non-finite values, missing fields, empty strings, and non-numeric text fail with invalid_input naming the field, and those failures are not billed. On success the body echoes real and imag with stable twelve-decimal rounding, a complex display string such as three plus four i or five minus two i, the non-negative modulus, the squared modulus real squared plus imag squared, a boolean is_zero that is true only when both parts are zero, and a formula string restating |z| equals sqrt of real squared plus imag squared. Use squared_modulus when you only need to compare distances or avoid the square-root step; the modulus field is always the non-negative root and is the value textbooks label |z|.

What does the complex modulus 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 →