Remainder & Modulo Calculator
When one whole number does not divide another exactly, the amount left over is the remainder. In maths and programming this is also called the modulo, written a mod b. This calculator gives the quotient and remainder, handles negative numbers with a non-negative remainder, and lists which numbers from 2 to 12 divide the dividend.
How to use the remainder & modulo calculator
- Enter the dividend a (the number being divided).
- Enter the divisor b.
- Press Calculate to see a = b × q + r.
Formula
Worked example: 157 ÷ 12
- Dividend a: 157
- Divisor b: 12
✓ Answer checked
- Quotient
- 13
- Remainder (a mod b)
- 1
- 157 is divisible by
- none of 2–12
Step-by-step working (2 steps)
Divide
How many whole times does 12 fit into 157?
Find what is left a = bq + r, 0 ≤ r < |b|
The remainder is always between 0 and |b| − 1.
How this was checked
- ✓ 12 × 13 + 1 = 157, with 0 ≤ 1 < 12.
For negative numbers the remainder is taken as non-negative (the mathematical "mod").
Frequently asked questions
What is 157 divided by 12 with remainder?
13 remainder 1, because 12 × 13 = 156.
What is −17 mod 5?
3, because −17 = 5 × (−4) + 3. Some programming languages return −2 instead.
What does 'divisible' mean?
The remainder is 0, so the division is exact.
Related calculators
Long Division Calculator
Do long division step by step: divide, multiply, subtract and bring down, with the quotient, remainder, decimal and mixed number.
GCF (HCF) Calculator
Find the greatest common factor (GCF), also called the HCF or GCD, of two or more numbers using Euclid's algorithm and prime factors.
Prime Number Calculator
Check whether a number is prime, see its prime factorisation and find the next prime.
