Free · Modular arithmetic

Integer Power Remainder

Calculate an integer power remainder across the full captured input range without constructing the enormous power.

  • Formula & worked example
  • Private in your browser
  • No signup
Go to tool

Calculator inputs

Loading calculator…

How to use this calculator

  1. Enter the known values in the units shown. Results update as you type.
  2. Where results are editable, change one to solve backwards. Lock a value to hold it fixed.
  3. Use the worked example to check the method. Reset restores the starting fields.

Private by default

Inputs and results stay in this browser tab. Bookify does not upload or store the values you enter.

Formula and method

3^5 mod7 =5.

base^exponent mod modulus

Worked example

Enter these known values and leave the other values blank.

x (base)
3
y (exponent)
5
n (divisor)
7
Power modulo
5

Assumptions and limitations

  • Base, exponent and modulus are positive integers no greater than 9e15.
  • The result is the least nonnegative remainder. A modulus of 1 returns 0; the output is forward-only.

Common questions

Can I enter a negative value?

This captured model requires positive inputs.

What is the output range?

The selected residue lies from zero through one less than the modulus.

References

Calculate remainders with exact integer arithmetic for positive integer inputs up to 9,000,000,000,000,000. Keep all inputs, the forward-only result and complete equation explanations.

Explore modular arithmetic or browse all math calculators.