Education Tools
Modulo Calculator
Modulo Calculator is part of Toolspire and is ready as soon as this page loads. Both numbers must be integers. The divisor cannot be zero. The remainder is always smaller than the absolute value of the divisor and, here, non-negative.
On this page
What you can do here
The multiple is in the detail
You can see the quotient that was thrown away.
Negative dividends stay non-negative
The remainder is not JavaScript’s signed % . −17 % 5 is −2 in JavaScript and 3 here.
Integers only
17.5 is not given a remainder. Scale it to an integer problem if you need one.
The sequence
How to use the Modulo Calculator
- 1
Type the number being divided first
17 mod 5 is dividend 17, divisor 5.
- 2
Check 2
Three fives are 15, and 17 − 15 is 2.
- 3
Try a negative dividend if you write clock arithmetic
The remainder should come back at 0 or above.
Worth knowing
- Modulo Calculator on Toolspire: 17 = 5 × 3 + 2, so 17 mod 5 = 2.
- The remainder uses the non-negative residue. −17 mod 5 is 3, because −20 is the multiple at or below −17 and the gap is 3.
- A divisor of 0 is rejected.
- Decimals are rejected. Modulo on this page is an integer operation.
A remainder you can add back
The useful identity is dividend = quotient × divisor + remainder, with a remainder that is at least 0 and strictly smaller than the divisor’s absolute value. JavaScript’s % operator keeps the sign of the dividend, so −17 % 5 is −2, and −2 does not satisfy that identity with a non-negative remainder. This page uses the non-negative one: −17 = (−4) × 5 + 3.
FAQ
Questions about Modulo Calculator
Where does Modulo Calculator run?
What is 17 mod 5?
What is −17 mod 5?
What about division by zero?
Can I use decimals?
Keep going
Related tools
Last updated Report a problem or suggest a feature