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.
Related tools
All Algebra & equations tools →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
- Enter your values: Base a, Exponent b, Modulus n.
- 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.