Skip to content
Allin

Modular exponentiation calculator

Compute aᵇ mod n efficiently with fast (square-and-multiply) exponentiation and big integers, so even astronomically large powers reduce in a fraction of a second. It normalises a negative or oversized base into the range 0…n−1 first, and supports negative exponents when the base is invertible modulo n. This is the core operation behind RSA, Diffie–Hellman and primality testing.

Modular multiplicative inverse calculatorFind a⁻¹ mod m — the number x with a·x ≡ 1 (mod m) — using the extended Euclidean algorithm. An inverse exists exactly when gcd(a, m) = 1; otherwise the tool reports that none exists. The modular inverse is what lets you 'divide' in modular arithmetic and is the step that produces the RSA private exponent d from the public exponent e.Exponent calculatorRaise a base to any power (exponent).Primitive root calculatorFind the primitive roots modulo n — the generators g whose powers g¹, g², … run through every number coprime to n before repeating (order equal to φ(n)). Primitive roots exist only when n is 1, 2, 4, pᵏ or 2pᵏ for an odd prime p; the tool reports the smallest one, the exact count φ(φ(n)) and lists them. They are the backbone of discrete-logarithm cryptography and Diffie–Hellman key exchange.Absolute Value Equation SolverSolve absolute-value equations like |x+3| = 5, 3|x+2| = 12 or |x+1| = |x−3| with step-by-step case analysis and exact solutions.Absolute Value Inequality SolverSolve absolute-value inequalities such as |x+3| < 5 or |x−2| > 3 and get the solution as an interval, with AND/OR reasoning explained step by step.Algebraic Expression SimplifierCombines like terms, expands or factors, with implicit multiplication understood (2x is 2·x). When a cancellation removes a factor, the excluded value is stated — (x²−4)/(x−2) is x+2 only for x ≠ 2, and that restriction is part of the answer.Beta Function CalculatorCompute the Euler Beta function B(x, y) = Γ(x)·Γ(y) / Γ(x+y) via a stable log-gamma.Boolean Algebra SimplifierReduces a boolean expression to a minimal sum of products, accepting every common notation — AB, A·B, A&B for AND, A+B or A|B for OR, ~A, !A or A' for NOT, plus XOR, NAND and NOR. Shows the prime implicants, not just the final answer.

The Modular exponentiation calculator turns Base a, Exponent b, Modulus n into aᵇ mod n, Base reduced (a mod n), instantly and for free. For instance, with Base a = 7, Exponent b = 256 and Modulus n = 13 it returns aᵇ mod n = 9 and Base reduced (a mod n) = 7.

How to use it

  1. Enter your values: Base a, Exponent b, Modulus n.
  2. Read the result instantly: aᵇ mod n, Base reduced (a mod n).

Frequently asked questions

What does the Modular exponentiation calculator actually compute?

It takes Base a, Exponent b and Modulus n and derives aᵇ mod n and Base reduced (a mod n) from them. The calculation is live as you type, so the result updates on every change.

What information do I need to provide?

3 values: Base a, Exponent b and Modulus n. Nothing else is required — no account, no file upload.

Can you show a worked example?

With Base a = 7, Exponent b = 256 and Modulus n = 13, the calculator returns aᵇ mod n = 9 and Base reduced (a mod n) = 7. Those figures come from running this exact tool, so you can reproduce them by entering the same values.

When would I actually use this?

Getting through a problem set: solving for the unknown, factoring an expression, and — more usefully — seeing the steps that got there.

What is the most common mistake?

Losing a solution when both sides are squared or divided by an expression. Squaring can add roots that do not satisfy the original equation, and dividing can remove one — check every answer back in the original.

What is the difference between the Modular exponentiation calculator and the Modular multiplicative inverse calculator?

This one returns aᵇ mod n and Base reduced (a mod n); the Modular multiplicative inverse calculator returns a⁻¹ mod m and gcd(a, m). That is the whole difference — open the one whose figure you need.

Is there a tool for the next step?

Exponent calculator is the closest one after this: Raise a base to any power (exponent).

Where do the figures come from, and how current are they?

The algebra is symbolic where the expression allows it and numeric otherwise, and the tool says which it used. Exact results are given as fractions or radicals rather than rounded decimals.

Further reading

All guides