How to use this tool
- Enter base, nonnegative exponent, positive modulus.
- Select Calculate to view the result.
- Check the method and assumptions below before using the result.
Input reference and sample values
Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.
| Input | Format and units | Sample |
|---|---|---|
| Base | Enter text using the format shown in the sample. | 7 |
| Nonnegative exponent | Enter text using the format shown in the sample. | 128 |
| Positive modulus | Enter text using the format shown in the sample. | 13 |
Result for these sample inputs
3
Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.
The method, explained
Repeated squaring reduces each product modulo m while processing exponent bits. This computes a^e mod m with bounded intermediate integer values.
Using base = 7, nonnegative exponent = 128, positive modulus = 13, the result is 3. Change these example inputs to match your task; use the method above to check each step.
What to keep in mind
At most 200 digits per input. Educational arithmetic; not a constant-time cryptographic implementation. Finite-precision arithmetic is used. Check the domain and the stated convention before using an approximation.
Common questions
Does it calculate the enormous power first?
No. Reducing after every multiplication gives the same remainder while avoiding the memory cost of representing the full integer power.
How can I check the result?
Repeated squaring reduces each product modulo m while processing exponent bits. This computes a^e mod m with bounded intermediate integer values. The worked example uses editable inputs. Calculations run on your device; no external API or account is required.
Methodology maintained by ClarityKit. How these tools are built and checked.