Modular Exponentiation Calculator
Enter a base, an exponent and a modulus to find the remainder of the power.
Any whole number, positive or negative.
A whole number, 0 or more.
A whole number other than 0.
Try
Result
You entered
Congruence
Show the work
Binary form of the exponent
The bits of the exponent say which moves to make. Read them from left to right: every bit after the first means square the running result, and a bit that is 1 also means multiply by the base. The exponent has 4 bits.
Square and multiply
Each line doubles the exponent by squaring, adds one more by multiplying by the base when the bit is 1, and then keeps only the remainder mod so the numbers stay small.
Using
Result
So , that is, the remainder is .