K

Modular Exponentiation Calculator

Modular exponentiation b^e mod m

Client-side computation for analysis, verification, and learning. Do not paste production secrets into untrusted sites; prefer local tooling for key material.

Educational / engineering use. RSA mode uses tiny primes for illustration only—not for real key generation.

Base b
Exponent e
Modulus m

Add Modular Exponentiation Calculator Free On Your Website

Paste this HTML on your site.

What is Modular Exponentiation Calculator?

Computes the result of raising a base to a large exponent within a modulus efficiently. A core operation in cryptographic systems like RSA and Diffie-Hellman where direct exponentiation would be computationally infeasible.

Modular Exponentiation Formula

result = b^e mod m

Computed efficiently using repeated squaring:

bemodm=1ife=0;(b(e/2))2modmifeiseven;bb(e1)modmifeisoddb^e mod m = { 1 if e=0 ; (b^(e/2))^2 mod m if e is even ; b · b^(e−1) mod m if e is odd }

Step-by-Step

  1. Enter base b, exponent e, modulus m.
  2. Convert exponent to binary.
  3. Repeatedly square and reduce modulo m.
  4. Multiply terms where exponent bit is 1.
  5. Return final reduced result.

Worked Example

Compute713mod11usingrepeatedsquaring.Compute 7^13 mod 11 using repeated squaring.
13inbinary=1101>usepowers8,4,1.13 in binary = 1101 -> use powers 8,4,1.
71mod11=77^1 mod 11 = 7
72mod11=57^2 mod 11 = 5
74mod11=37^4 mod 11 = 3
78mod11=97^8 mod 11 = 9
So713mod11=(787471)mod11=(937)mod11=189mod11=2.So 7^13 mod 11 = (7^8 * 7^4 * 7^1) mod 11 = (9*3*7) mod 11 = 189 mod 11 = 2.

Where Modular Exponentiation Calculator Is Applied

  • Core computation inside RSA encryption/decryption
  • Diffie-Hellman key exchange
  • ElGamal encryption scheme
  • Primality testing (Miller-Rabin algorithm)
  • Generating cryptographic keys
  • Zero-knowledge proof systems

Related Cryptography Calculators

Explore similar calculators to streamline your workflow.

View all
Calculator By Adil Balti, Content Proofread and Verify by Muhammad Kumail & Gulzar Abbas.

About Calculators.is

At Calculators.is our sole focus is to provide 100% accurate, fast, comprehensive, convenient, easy-to-use free online calculators to everyone to use without spending a single $ on any online Calculators.

All the calculators on our website are designed and developed by our own team, and each one is put through strict, comprehensive testing before being made live on our website.

About, Founder and calculator.is.