Modular exponentiation calculator

Compute base raised to an integer exponent modulo a positive integer.

Enter values

Start with the example below, or enter your own values.

How it works

Square and multiply using exact BigInt arithmetic. Input integers have at most 100 decimal digits.

Try an example

Base: 7; Exponent: 13; Modulus: 23. The form starts with these values; change them to explore your own case.

Example result: 20

  1. Reduce the base modulo m.
  2. Square and multiply using the binary digits of the exponent.

Learn more in Integer computing and radix tools.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.