What mod means
Mod gives the remainder. 17 mod 5 is 2, because 17 holds three whole fives and leaves 2 over.
The modulus is the number you divide by. It cannot be zero, because dividing by zero has no answer.
Worked example
17 mod 5 is 2. There are 3 whole groups of 5, which take out 15, and 15 + 2 = 17.
Negative numbers count forward from zero here, so -17 mod 5 is 3 rather than -2. That is the convention most programming languages and timetables use.
Where remainders matter
Clock arithmetic is mod 12 or mod 24: 15:00 plus 10 hours is 01:00 the next day.
Sharing items into equal groups, checking divisibility and scheduling repeated events all come down to a remainder.
Inputs for the mod calculator
Number
The number being divided. It can be negative and must be a whole number.
Divide by (modulus)
The size of each group. It cannot be zero.
CALCULATOR QUESTIONS
Mod on a calculator questions
What is 17 mod 5?
2, because 17 is three fives plus 2.
What does mod 10 give me?
The last digit of a whole number. 1234 mod 10 is 4.
Why is -17 mod 5 equal to 3?
The remainder is counted forward from zero, so -17 is 3 more than -20, which is a multiple of 5.
Can I use decimals?
No. Mod is defined for whole numbers, so this page asks for integers.
