Find the remainder
Check: 5 × 9 + 2 = 47. For these numbers every convention gives the same remainder.
| Convention | Quotient | Remainder |
|---|---|---|
Truncated (school, C, Java, JavaScript %) | 9 | 2 |
Floored (Python %, Excel MOD) | 9 | 2 |
| Euclidean (always ≥ 0) | 9 | 2 |
Updated 2026-11-25
What is a remainder?
When a whole number does not divide exactly, the remainder is the amount left over. For 47 ÷ 5, five groups of 9 use up 45, and 2 is left: 47 ÷ 5 = 9 R 2. Every division of whole numbers fits the division equation
dividend = divisor × quotient + remainder → 47 = 5 × 9 + 2
For positive numbers the remainder is always at least 0 and smaller than the divisor. If you get a remainder of 5 or more when dividing by 5, the quotient is too small. The calculator prints this check under every answer. To see how the remainder appears in written working, open the same problem in the long division calculator.
Remainder, decimal and fraction
The remainder is the numerator of the leftover fraction: 47 ÷ 5 = 9 R 2 = 9 2/5 = 9.4. You can also go backwards from a pocket-calculator answer:
- Divide on a calculator: 1000 ÷ 7 = 142.857…
- Take the whole-number part: 142.
- Multiply back and subtract: 1000 − 7 × 142 = 1000 − 994 = 6. The remainder is 6.
Avoid multiplying the decimal part (0.857… × 7) for large numbers, because the rounded digits can give 5.99999 instead of 6. For the exact decimal and fraction forms, use the division calculator.
Remainders with negative numbers
With a negative dividend or divisor, more than one answer satisfies the division equation, so different textbooks and programming languages choose differently. The calculator shows all three common conventions:
- Truncated division: the quotient is rounded toward zero, and the remainder takes the sign of the dividend. Used by C, C++, Java and the JavaScript
%operator. - Floored division: the quotient is rounded down (toward −∞), and the remainder takes the sign of the divisor. Used by Python's
//and%and by Excel'sMOD(). - Euclidean division: the remainder is never negative (0 ≤ r < |divisor|). This is the definition used in number theory.
| Division | Truncated (JS %) | Floored (Python %) | Euclidean (r ≥ 0) |
|---|---|---|---|
| 17 ÷ 5 | 3 R 2 | 3 R 2 | 3 R 2 |
| −17 ÷ 5 | −3 R −2 | −4 R 3 | −4 R 3 |
| 17 ÷ −5 | −3 R 2 | −4 R −3 | −3 R 2 |
| −17 ÷ −5 | 3 R −2 | 3 R −2 | 4 R 3 |
Each row passes the check. For −17 ÷ 5: truncated 5 × (−3) + (−2) = −17, floored 5 × (−4) + 3 = −17. In code, Python gives -17 % 5 == 3 and divmod(-17, 5) == (-4, 3), while JavaScript gives -17 % 5 === -2. More language details are on the division in programming page.
Modulo in everyday problems
"a mod n" is the remainder after dividing a by n. It answers wrap-around questions:
- Clock time: 100 hours from midnight is 100 mod 24 = 4, so 4:00 (four days later).
- Days of the week: 30 days after a Wednesday is 30 mod 7 = 2 days further on, a Friday.
- Sharing: 47 stickers among 5 children gives 9 each with 2 left over.
- Even or odd: n mod 2 is 0 for even numbers and 1 for odd ones.
Word problems sometimes need the quotient rounded up instead: 47 people in cars that seat 5 need 10 cars, not 9, because the 2 remaining people still need a seat. Quick divisibility tests that tell you whether the remainder is 0 without dividing are collected on the divisibility rules page.
Frequently asked questions
How do you find the remainder?
Divide, keep only the whole-number part of the quotient, multiply it by the divisor and subtract from the dividend. For 47 ÷ 5: the quotient is 9, and 47 − 5 × 9 = 2.
Can a remainder be larger than the divisor?
No. If the remainder is equal to or larger than the divisor, another whole group fits, so the quotient should be one bigger.
What is the remainder of −17 divided by 5?
It depends on the convention: −2 with truncated division (JavaScript, C, Java) and 3 with floored or Euclidean division (Python, Excel MOD).
Is modulo the same as remainder?
For positive numbers, yes: 47 mod 5 = 2. With negative numbers, "mod" in mathematics usually means the non-negative (Euclidean) remainder, while the % operator in many languages returns a truncated remainder that can be negative.
How do I write a remainder as a fraction or decimal?
Put the remainder over the divisor: 47 ÷ 5 = 9 R 2 = 9 2/5 = 9.4.
How do I get the remainder in Excel?
Use =MOD(A1, B1) for the remainder and =QUOTIENT(A1, B1) for the whole-number quotient. MOD gives the result the sign of the divisor, so =MOD(-17, 5) returns 3.