Modulo: worked example
| Dividend | 47 |
|---|---|
| Divisor | 5 |
| Remainder (mod) | 2 |
| Whole-number quotient | 9 |
Modulo: formula
Enter the dividend, the number being divided, and the divisor, the number you divide by, which must not be zero. The calculator returns the whole-number quotient and the remainder, the modulo. Use whole numbers for the usual definition.
With negative numbers, programming languages disagree about the sign of the remainder, so check the convention if you use the result in code.
Modulo: changing Dividend
| Dividend | Remainder (mod) | Whole-number quotient |
|---|---|---|
| 38 | 3 | 7 |
| 42 | 2 | 8 |
| 47 (example) | 2 | 9 |
| 52 | 2 | 10 |
| 56 | 1 | 11 |
Modulo: compare input ranges
| Input | Tested from | To | Remainder (mod): low input | Remainder (mod): high input | Swing |
|---|---|---|---|---|---|
| Divisor | 4 | 6 | 3 | 5 | 2 (100%) |
| Dividend | 42 | 52 | 2 | 2 | 0 |
Modulo: individual input comparisons
| Input | Value | Remainder (mod) | Whole-number quotient |
|---|---|---|---|
| Dividend | 38 | 3 | 7 |
| 42 | 2 | 8 | |
| 47 | 2 | 9 | |
| 52 | 2 | 10 | |
| 56 | 1 | 11 | |
| Divisor | 3 | 2 | 15 |
| 4 | 3 | 11 | |
| 5 | 2 | 9 | |
| 6 | 5 | 7 | |
| 7 | 5 | 6 |
Modulo: which assumptions move the result?
Modulo: values and definitions
| Quantity and definition | Value used |
|---|---|
| Dividend — The number being divided. | 47 |
| Divisor — The number you divide by. It cannot be zero. | 5 |
| Remainder (mod) | 2 |
| Whole-number quotient | 9 |
Modulo: half and double Divisor
| Divisor | Remainder (mod) |
|---|---|
| 2.5 | 2 |
| 5 | 2 |
| 10 | 7 |
Common error: Trusting a negative remainder from a programming language. Many return the sign of the dividend, so minus 7 mod 5 shows as minus 2 there; the mathematical remainder is 3, which is what a wrapped schedule needs.
For negative dividends, mathematical modulo and the operator in some languages differ: the remainder may be negative in one and positive in the other. Decimal operands are handled differently between tools. The remainder is always smaller in size than the divisor.
Modulo does not tell you how many times something repeats, only the leftover.
Number Theory & Precision calculators: Fibonacci Calculator, Prime Number Calculator, GCF & LCM Calculator, Prime Factorization Calculator, Scientific Notation Calculator, Percent Error Calculator.
The remainder is the part of a count that does not fill another whole cycle. Forty-seven days is six full weeks and five days more, so 47 mod 7 is 5. That single idea sits under clock arithmetic, repeating schedules, check digits and array wraparound.
The quotient beside it says how many complete cycles fit, so both halves of the division are visible at once.
Multiply the divisor by the quotient and add the remainder. You should land back on the dividend exactly.
Relate it to divisibility on the GCF and LCM calculator, and see the day of the week calculator, which uses modulo 7. The number base converter uses repeated division, and the prime number calculator tests divisibility. The clock calculators handle hours modulo 12 or 24.
What does modulo mean?
The remainder left after dividing one whole number by another. 47 mod 5 is 2 because 47 equals 9 times 5 plus 2.
How do I tell if a number is even?
Take it modulo 2. A remainder of 0 means the number is even and a remainder of 1 means it is odd, which also works for negative numbers.
Why does modulo appear in clocks and calendars?
Because time repeats in cycles, so hours wrap around after 12 or 24 and weekdays after 7, which is what modulo arithmetic describes.