Modular Exponentiation
Compute a^b mod m with fast binary exponentiation

🔒 No cookies · Method · · Disclaimer · Modular Exponentiation
Modular Exponentiation helps you compute a^b mod m with fast binary exponentiation without a spreadsheet. Enter Base (a), Exponent (b) and Modulus (m) in any order — Modular Exponentiation recalculates on every edit. In Modular Exponentiation the working sits beside the answer. That makes Modular Exponentiation handy for quick estimates anywhere. Nothing typed into Modular Exponentiation leaves your device or the tab. Modular Exponentiation sits in the Math section next to free online modular exponentiation calculator and modular exponentiation calculator fast power. Modular Exponentiation has no learning curve. The fields are labeled. Start with Modular Exponentiation; the first number takes seconds.
What does the Modular Exponentiation do?
Modular Exponentiation works out the a^b mod from the Base, Exponent, and Modulus, using Math conventions. With the defaults, modular exponentiation gives an a^b mod of 2^100 mod 1000000007 = 976371253.
- Inputs: Base, Exponent, and Modulus.
- Output: the a^b mod, and the operations that led to it.
- Method: the standard Math formula behind the a^b mod, evaluated entirely in your browser.
Quick answer
modular exponentiation returns an a^b mod of 2^100 mod 1000000007 = 976371253 with the default inputs (base of 2, exponent of 100, modulus of 1,000,000,007).
How does the Modular Exponentiation work?
Modular Exponentiation computes the a^b mod directly from your inputs — the Base, Exponent, and Modulus feed the formula. Nothing is uploaded: the a^b mod is computed locally and appears as you type.
How the Modular Exponentiation works
Modular Exponentiation keeps the whole calculation in front of you — the Base, Exponent, and Modulus, the formula, the intermediate steps, and a worked example you can reproduce line by line.
How to use it
- Base — used in the first modular exponentiation stage, so entering it accurately beats any later refinement.
- Exponent — read as written by the Math formula — no scaling, no conversion of the number.
- Modulus — the modular exponentiation field most likely copied from elsewhere, so check its unit first.
- Under the a^b mod, Modular Exponentiation lists the figures it derived on the way, which is useful when someone asks how the number was reached.
- Re-enter the same numbers on Modular Exponentiation with one deliberate change, and the difference in the figure belongs to that field alone.
The formula behind the result
The order of operations on the modular exponentiation page is fixed by the Math convention, which is why two runs with identical Base, Exponent, and Modulus cannot disagree.
Worked example: with base of 2, exponent of 100, modulus of 1,000,000,007, this modular exponentiation calculation returns 2^100 mod 1000000007 = 976371253. The same run reports O(log b) binary exponentiation.
The steps it follows:
- Square-and-multiply over the bits of 100
- Result: 976371253
Understanding the result
The number at the top of the modular exponentiation page is only meaningful next to the units and the Base, Exponent, and Modulus that produced it.
Where it helps
Typical moments for the modular exponentiation page: checking a plan against reality, holding one number fixed while another moves, and reproducing a number someone else worked out, or a quick check before a figure goes into a document.
Common mistakes
Leaving a dropdown on its first option is the silent error with Modular Exponentiation: the default mode is one valid case, not necessarily yours.
Tip: Modular Exponentiation returns 2^100 mod 1000000007 = 976371253 at its defaults; double the Base (a) and it returns 4^100 mod 1000000007 = 499445071.
Assumptions and limitations
The figure Modular Exponentiation reports is only as complete as the inputs: anything the page does not ask for sits outside the calculation.
Why use this calculator
Because the Base, Exponent, and Modulus never leave the tab, Modular Exponentiation is safe to use with real figures rather than rounded ones.
Frequently Asked Questions
Which figure does modular exponentiation produce?
Anyone who has to explain a output rather than just quote it will find Modular Exponentiation useful, because the page records how the figure was reached instead of only what it is. Because there is no sign-up wall and no upload step, Modular Exponentiation answers the output question in the time it takes to type the numbers.
How is the a^b mod calculated?
The first steps are result: 976371253. No step in Modular Exponentiation depends on a hidden default — the formula reads the Base, Exponent, and Modulus exactly as displayed, including zeros.
What should I have ready for Modular Exponentiation?
Modular Exponentiation needs Base, Exponent, and Modulus and nothing else.
What if the Base (a) were twice as large?
At the defaults Modular Exponentiation returns 2^100 mod 1000000007 = 976371253; doubling Base (a) to 4 moves it to 4^100 mod 1000000007 = 499445071.
What does the result from this page’s calculator tell you?
The main number the modular exponentiation returns is the a^b mod for your exact inputs. Modular Exponentiation returns a point estimate for the values shown and says nothing about how confident you should be in those values.
When would someone reach for the page?
Between checking a plan against reality, holding one number fixed while another moves, and reproducing a number someone else worked out, Modular Exponentiation covers the Math questions that come up often enough to be worth doing properly. Use the step list on the modular exponentiation page as a second opinion when a number from elsewhere looks too round to be true.
Negative Binomial Probability and other Math tools
Negative Binomial Probability · Triangular Prism Volume · Combined Work Rate · Percentage Change · Prime Factorization · Pythagorean Theorem · Math Guides