AnsRioSmart tools. Clear answers.
Home / Math & statistics / Modular exponentiation
Math & statistics

Modular exponentiation

Modular exponentiation: Compute base^exponent mod modulus using exponentiation by squaring with exact BigInt integer arithmetic.

Enter your values ⌁ Runs on your device

Your inputs stay in this browser and are not saved to an account.

YOUR RESULT
Ready when you are.

Enter your values, then select Calculate.

QUICK ANSWER

2

Use the inputs above for your own values. The result follows the method and assumptions shown below.

How it works

Compute base^exponent mod modulus using exponentiation by squaring with exact BigInt integer arithmetic.

Input definitions

Integer base
Enter the value in the labeled unit.
Nonnegative integer exponent
Enter the value in the labeled unit.
Positive integer modulus
Enter the value in the labeled unit.

A worked example

Integer base
7
Nonnegative integer exponent
13
Positive integer modulus
11
2

Assumptions & limits

Uses the units and scope stated in the input labels. Results are rounded for display; verify the model is appropriate for your situation.

Sources & review

Maintained by AnsRio. Methods and examples are reviewed against the stated formula; this is not professional certification.

Method updated 2026-10-18. Reviewed against the stated method and example. Our verification approach.

Report an issue with this tool or suggest an improvement ↗

Common questions

Is this suitable for private cryptographic keys?

No. The algorithm is educational and is not constant time. Use an audited cryptographic library for security-sensitive operations.

How does Modular exponentiation work?

Compute base^exponent mod modulus using exponentiation by squaring with exact BigInt integer arithmetic.

What should I check before using Modular exponentiation?

Uses the units and scope stated in the input labels. Results are rounded for display; verify the model is appropriate for your situation.

↗
Private tools for everyday decisions.

No sign-up. Tool inputs stay on your device.

How we work