Power Mod Calculator
Calculate a^e mod m with normalized residues, binary exponent steps, and fast square-and-multiply verification.
Last Updated: May 2026
Power Mod Result
7
Normalized Base
7
Exponent Bits
4
Operations
3 multiply, 3 square
Power Mod Inputs
Enter a base, nonnegative exponent, and modulus greater than 1. The calculator uses square-and-multiply so large powers stay manageable.
Result Check
| Item | Calculation | Result |
|---|---|---|
| Expression | 7^13 mod 19 | 7 |
| Base normalization | 7 mod 19 | 7 |
| Binary exponent | 1101 | 4 bits |
| Fast method | Square-and-multiply | 4 loop steps |
Modular Rules
| Check | Rule | Value |
|---|---|---|
| Range check | 0 <= result < 19 | Pass |
| Negative base handling | Base is reduced before exponentiation | 7 |
| Zero exponent rule | a^0 mod m | Not used |
| Complexity | O(log exponent) | 4 exponent bits |
Square-and-Multiply Steps
| Binary step | Multiply action | Running result | Next square |
|---|---|---|---|
| Bit 0 = 1 | 1 x 7 mod 19 | 7 | 7^2 mod 19 = 11 |
| Bit 1 = 0 | Skip multiply for this bit | 7 | 11^2 mod 19 = 7 |
| Bit 2 = 1 | 7 x 7 mod 19 | 11 | 7^2 mod 19 = 11 |
| Bit 3 = 1 | 11 x 11 mod 19 | 7 | 11^2 mod 19 = 7 |
Number Theory Notice
This calculator is for integer modular arithmetic and educational number theory. For cryptographic production systems, use audited libraries and constant-time implementations rather than manual calculations.
Reviewed For Methodology, Labels, And Sources
Every CalculatorWallah calculator is published with visible update labeling, linked source references, and review of formula clarity on trust-sensitive topics. Use results as planning support, then verify institution-, policy-, or jurisdiction-specific rules where they apply.
Reviewed By
Jitendra Kumar, Founder & Editorial Standards Lead, reviews methodology, labels, assumptions, and trust-sensitive publishing decisions for this topic area.
Review editor profileTopic Ownership
Sales tax and tax-sensitive estimate tools, Education and GPA planning calculators, Health, protein, and screening-formula pages, Platform-wide publishing standards and methodology
See ownership standardsMethodology & Updates
Page updated May 2026. Trust-critical pages are reviewed when official rates or rules change. Evergreen calculator guides are checked on a recurring quarterly or annual cycle depending on topic volatility.
How to Use the Power Mod Calculator
Enter the base, exponent, and modulus. The exponent must be zero or positive, and the modulus must be greater than 1.
The calculator reduces the base modulo m, converts the exponent into binary, and uses square-and-multiply to calculate the final remainder without expanding the full power.
Step 1: Enter the base
Use any integer, including a negative value.
Step 2: Enter the exponent
Use a nonnegative integer exponent.
Step 3: Enter the modulus
Use an integer modulus greater than 1.
Step 4: Review the binary steps
Check how each exponent bit affects the running result and next square.
How This Power Mod Calculator Works
Modular exponentiation finds the remainder of a power without expanding the full power. The calculator first reduces the base into the standard remainder range from 0 through m - 1.
It then reads the exponent in binary. Each loop squares the current factor modulo m. If the current binary digit is 1, the calculator also multiplies that factor into the running result.
Because every intermediate value is reduced modulo m, the method works efficiently even when the exponent is much larger than you would want to expand by hand.
Power Mod Guide
Core Formulas
| Concept | Formula | Use |
|---|---|---|
| Power mod | a^e mod m | The remainder after raising a to e and dividing by m. |
| Normalize base | a mod m | Reduce the base before repeated multiplication. |
| Square-and-multiply | read exponent bits | Multiply only when a binary exponent bit is 1. |
| Repeated squaring | a, a^2, a^4, a^8, ... mod m | Keeps every intermediate value bounded by m. |
| Zero exponent | a^0 mod m = 1 mod m | Valid for modulus greater than 1. |
Examples
| Problem | Result | Notes |
|---|---|---|
| 7^13 mod 19 | 7 | Small example with several binary exponent steps. |
| 42^17 mod 3233 | 2557 | RSA-style modular exponentiation example. |
| 5^117 mod 97 | 77 | Large exponent handled with repeated squaring. |
| (-12)^9 mod 35 | 8 | Negative base is normalized before powering. |
Why Binary Exponents Help
A power such as a^117 does not need 116 repeated multiplications. Since 117 can be represented in binary, the calculator builds the needed powers a, a^2, a^4, a^8, and so on, reducing each one modulo m.
This is why power mod calculations are practical in cryptography and number theory: the number of loop steps grows with the number of binary digits in the exponent, not with the exponent itself.
Keep the research moving with Modulo Calculator, Inverse Modulo Calculator, Multiplicative Inverse Modulo Calculator, and Integer Calculator.
Frequently Asked Questions
Related Calculators
Modulo Calculator
Calculate remainders, quotients, congruence checks, and modular operations.
Use Modulo CalculatorInverse Modulo Calculator
Find modular inverses with extended Euclid, Bezout identity, and gcd checks.
Use Inverse Modulo CalculatorMultiplicative Inverse Modulo Calculator
Find modular multiplicative inverses with coprime tests and verification.
Use Multiplicative Inverse Modulo CalculatorInteger Calculator
Calculate signed integer arithmetic, powers, GCD, LCM, parity, and factors.
Use Integer CalculatorScientific Calculator
Use advanced arithmetic, powers, roots, logarithms, and trigonometry.
Use Scientific CalculatorSources & References
- 1.Wolfram MathWorld - Modular Arithmetic(Accessed May 2026)
- 2.Wolfram MathWorld - Modular Exponentiation(Accessed May 2026)
- 3.Khan Academy - Modular Arithmetic(Accessed May 2026)