Exact Modular Exponentiation Calculator
Calculate a large integer power modulo a positive integer without constructing the full power.
YOUR CALCULATION
Result
β
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Normalize the base residue, then scan the exponent by halving it. Square the running base each time and multiply the accumulator when an exponent bit is one.
a^e mod m by repeated squaring; each multiplication is reduced modulo m
Worked example
7^560 modulo 561 is 1. For an easier check, 3^5=243 and 243 modulo 7 is 5.
Assumptions and input details
Plain decimal integers only, without separators, fractions or exponent notation; each input up to 100 digits. Exponent must be nonnegative and modulus positive, including modulus one. The exponent-zero convention is the empty product 1, reduced modulo m, also for base zero. BigInt keeps the residue exact. At most the first 30 binary iterations are displayed and omissions are counted. This educational arithmetic is not a constant-time cryptographic implementation.
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Residues, congruence solutions, quota comparisons and final allocations use exact integer arithmetic. Decimal quota displays, if present, are approximate; read the documented input and tie rules.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Divide signed integers with a nonnegative remainder. Verify the identity and use the same modulo convention for cyclic positions and clock arithmetic.
Find the exact greatest common divisor and least common multiple of 2β20 integers. Inspect progressive reductions, divisibility checks and Euclidean division steps.
Find the complete integer solution class for simultaneous congruences, including compatible non-coprime moduli.
Reserved advertising space.