Modulo Calculator

Modulo gives the remainder after division and is used for clock arithmetic, cycles, checking even and odd numbers, hash tables, check digits and repeating patterns. 47 divided by 5 is 9 with remainder 2, since 5 times 9 is 45. If you want to know what weekday it will be in 100 days, divide by 7 and use the remainder.

A remainder of zero means the divisor divides the dividend exactly.

Modulo Calculator: inputs

Calculated result
Remainder (mod)2
Whole-number quotient9

Modulo Calculator: Dividend sensitivity

Modulo Calculator: Dividend and Remainder (mod)5 calculations vary the “Dividend” input while holding the other entered inputs constant.383422472522561

Modulo: worked example

Dividend47
Divisor5
Remainder (mod)2
Whole-number quotient9

Modulo: formula

Quotient = ⌊dividend ÷ divisor⌋; remainder = dividend − divisor × quotient

Modulo: Wolfram MathWorld

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

DividendRemainder (mod)Whole-number quotient
3837
4228
47 (example)29
52210
56111

Modulo: compare input ranges

InputTested fromToRemainder (mod): low inputRemainder (mod): high inputSwing
Divisor46352 (100%)
Dividend4252220

Modulo: individual input comparisons

InputValueRemainder (mod)Whole-number quotient
Dividend3837
4228
4729
52210
56111
Divisor3215
4311
529
657
756

Modulo: which assumptions move the result?

Modulo: Remainder (mod) as Divisor changesRemainder (mod) starts at 2. Moving Divisor from 3 to 7 changes it to 5, with Dividend 47 kept fixed.3243526575
Chart quantityDisplayed settings
Divisor3 → 7
Remainder (mod)2 → 5
Dividend47

Modulo: values and definitions

Quantity and definitionValue used
Dividend — The number being divided.47
Divisor — The number you divide by. It cannot be zero.5
Remainder (mod)2
Whole-number quotient9

Modulo: half and double Divisor

DivisorRemainder (mod)
2.52
52
107

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.