iHow it is calculated
The modulo operation gives the remainder of a division. The result is always between 0 and n−1, “wrapping around” like clock hands:
17 mod 5 = 2 (quotient 3, remainder 2). Modular power: 2¹⁰ mod 7 = 1024 mod 7 = 2.
Instantly calculate the remainder (a mod n) and the modular power (aᵇ mod n), useful in programming and cryptography.
Enter values
The remainder of a divided by n. The result is always between 0 and n−1.
17 mod 7 = 3
17 mod 7 = 3Standard mathematical formulas. Instant in-browser calculation, no account. Exact results for the values you enter.
The modulo operation gives the remainder of a division. The result is always between 0 and n−1, “wrapping around” like clock hands:
17 mod 5 = 2 (quotient 3, remainder 2). Modular power: 2¹⁰ mod 7 = 1024 mod 7 = 2.
The operation “a mod n” gives the remainder of a divided by n. For example, 17 mod 5 = 2, because 17 = 3 × 5 + 2.
Divide a by n and keep the remainder. The calculator shows it directly, along with the integer quotient.
17 mod 5 = 2. The quotient is 3, and the remainder (the modulo result) is 2.
A system where numbers “wrap around” after reaching the modulus, like clock hands (mod 12 or 24). 14:00 = 2 in the afternoon.
It computes aᵇ and then the remainder modulo n, efficiently even for large exponents. It is essential in cryptography (e.g. RSA).
Because the remainder is what is left after subtracting all whole multiples of n; it cannot reach n, otherwise one more multiple would fit.
This calculator always returns a non-negative remainder: −1 mod 5 = 4. This keeps the result within 0…n−1.
Cryptography, hash functions, pseudo-random number generation, check digits (ISBN, IBAN) and computing days of the week.