How to Find the Remainder: 5 Methods With Worked Examples
The remainder is what stays behind after division. Learn 5 methods to find the remainder by hand, on a calculator, and in code, with the formula, examples and practice problems.
The remainder is the whole number left over after you divide one integer by another as many whole times as it will go. To find the remainder, divide the dividend by the divisor, multiply the divisor by the whole-number quotient, then subtract that product from the dividend. Take 17 divided by 5. The quotient is 3 and the remainder is 2, because 5 × 3 = 15 and 17 − 15 = 2. The Remainder Calculator returns both values at once, though you can reach the same answer by hand in under ten seconds once the steps click.
Why bother? Finding the remainder tells you whether one number divides another cleanly, and it shrinks big numbers down to a small, workable range. It also exposes the repeating structure hidden inside number sequences, and it sidesteps the rounding error that decimals bring in. That’s 4 payoffs from a single operation. You’ll meet it in long division, modular arithmetic, cryptography, hash functions, calendar math, and every programming language that ships a modulo operator.
Every remainder problem has 4 parts: the dividend (the number being divided), the divisor (the number dividing it), the quotient (how many whole times the divisor fits), and the remainder (the leftover). What follows walks through the remainder formula, 5 methods for finding the remainder, faster mental shortcuts, remainders in code, negative dividends, and the polynomial remainder theorem.
What Is a Remainder in Math?
A remainder is the amount left over when a dividend is divided by a divisor and only whole copies of the divisor are removed. The remainder is always a whole number, and it is always smaller than the divisor.
Dividing 23 by 4 removes 5 whole copies of 4, which accounts for 20. The leftover 3 is the remainder. Writing 23 ÷ 4 = 5.75 gives the same information in decimal form, but 0.75 is not the remainder. The remainder is 3.
Three conditions define a valid remainder:
- The remainder is greater than or equal to 0.
- The remainder is strictly less than the divisor.
- The remainder is a whole number, never a fraction or a decimal.
A divisor of 4 therefore produces exactly 4 possible remainders: 0, 1, 2 and 3. A divisor of 7 produces 7 possible remainders, from 0 through 6. These sets are the congruence classes of modular arithmetic, and they explain why remainders compress infinite number lines into small finite groups. Readers who need the plain distinction between the two output values should read how the quotient and remainder differ.
The Remainder Formula
The remainder formula is r = a − (b × q), where a is the dividend, b is the divisor, q is the whole-number quotient, and r is the remainder.
This formula comes from Euclidean division, also called the division algorithm. Euclidean division states that for any integer a and any positive integer b, exactly one pair of integers q and r exists such that:
a = b × q + r, with 0 ≤ r < b.
Applying the formula to 247 ÷ 12:
- Divide: 247 ÷ 12 = 20.58, so the whole-number quotient q is 20.
- Multiply: 12 × 20 = 240.
- Subtract: 247 − 240 = 7.
- Check: 7 is less than 12, so the remainder is valid.
The remainder is 7, and the complete statement is 247 = 12 × 20 + 7.
The quotient q equals the floor of a ÷ b, meaning the decimal is dropped rather than rounded. Rounding 20.58 up to 21 produces 12 × 21 = 252, which exceeds 247 and forces a negative leftover. Always round the quotient down, never to the nearest whole number.
Method 1: Subtract the Nearest Multiple
The fastest way of finding the remainder by hand is to subtract the largest multiple of the divisor that stays below the dividend.
Find the remainder of 1234 ÷ 7:
- Estimate the multiple: 7 × 100 = 700, 7 × 170 = 1190, 7 × 176 = 1232.
- Subtract: 1234 − 1232 = 2.
- Confirm: 2 is less than 7.
The remainder is 2.
This method needs no division at all, only multiplication and one subtraction. It works best when the divisor is small and the multiples are easy to build in steps of 10 and 100.
Method 2: Long Division
Long division produces the quotient and the remainder in the same pass, which makes it the standard classroom method for dividends of 3 digits or more.
Find the remainder of 947 ÷ 8:
- Divide 9 by 8 → 1, remainder 1. Bring down 4 to make 14.
- Divide 14 by 8 → 1, remainder 6. Bring down 7 to make 67.
- Divide 67 by 8 → 8, remainder 3.
- Read the result: quotient 118, remainder 3.
Check the answer with the remainder formula: 8 × 118 = 944, and 947 − 944 = 3. The final leftover at the bottom of the long division is the remainder. A digit-by-digit walkthrough of every step, including dividends with internal zeros, sits in the full long division method.
Method 3: Repeated Subtraction
Repeated subtraction finds the remainder by removing the divisor from the dividend until the leftover drops below the divisor.
Find the remainder of 17 ÷ 5 via repeated subtraction: 17 − 5 = 12, 12 − 5 = 7, 7 − 5 = 2. Stopping at 2 gives a quotient of 3 subtractions and a remainder of 2.
This method is slow for large dividends and precise for small ones. It also shows why the remainder is unique: subtracting the divisor one more time would push the leftover below 0, which the definition forbids.
Method 4: Divisibility Rules First
Divisibility rules answer whether the remainder is 0 before any division starts, and several rules return the exact remainder directly.
Three rules produce the remainder in one step:
- Divide by 9: the remainder equals the digit sum reduced modulo 9. The digits of 1234 sum to 10, and 10 − 9 = 1, so 1234 ÷ 9 leaves 1.
- Divide by 11: the remainder equals the alternating digit sum. For 1234, the calculation 4 − 3 + 2 − 1 = 2, so the remainder is 2.
- Divide by 10, 100 or 1000: the remainder equals the final 1, 2 or 3 digits. The remainder of 45678 ÷ 100 is 78.
Divide by 5 and the remainder depends only on the last digit: a final digit of 0 or 5 leaves 0, a final digit of 7 leaves 2. Divide by 2 and the remainder is 0 for even numbers and 1 for odd numbers. Running a quick test first saves the entire calculation whenever the answer turns out to be zero, which is the reason for checking divisibility before you divide.
Method 5: The Modulo Operator
Every programming language exposes the remainder through a modulo operation, written with the percent sign in most syntaxes.
| Language | Expression | Result |
|---|---|---|
| Python | 17 % 5 | 2 |
| JavaScript | 17 % 5 | 2 |
| C | 17 % 5 | 2 |
| Java | 17 % 5 | 2 |
| Excel | =MOD(17,5) | 2 |
The Python modulo operator and the JavaScript remainder operator agree on positive inputs and disagree on negative ones. Python evaluates -7 % 3 as 2, while C, C++, Java and JavaScript evaluate -7 % 3 as −1, a result compared in full across programming languages. The split traces back to floored division versus truncated division, and it is the single most common source of off-by-one bugs in modular code.
Python also ships divmod(17, 5), which returns the tuple (3, 2) and delivers the quotient and the remainder in one call. Wolfram Alpha accepts the query 17 mod 5 and returns 2. A full account of the operator, its precedence and its edge cases sits in the same operation in programming.
How to Find the Remainder on a Calculator
A standard calculator finds the remainder in 3 steps: divide the dividend by the divisor, subtract the whole-number part, then multiply the decimal part by the divisor.
Find the remainder of 100 ÷ 7 on a basic calculator:
- Enter 100 ÷ 7 = 14.285714…
- Subtract 14 to isolate the decimal: 0.285714…
- Multiply 0.285714… by 7 = 1.999998, which rounds to 2.
The remainder is 2. Verify with the formula: 7 × 14 = 98, and 100 − 98 = 2.
Step 3 exposes the weakness of this approach. Working with floating point precision truncates the decimal expansion, so long dividends return 1.999998 instead of 2, and a remainder of 0 sometimes appears as 6.9999999. Scientific calculators avoid the drift entirely. Casio models offer the ÷R key, which prints the quotient and the remainder side by side, and the TI-30 series exposes the same behaviour through its integer division function. Round the final product to the nearest whole number whenever the calculator method is used.
How to Find the Remainder Without a Calculator
Four shortcuts remove the arithmetic load from mental remainder work:
- Break the dividend into friendly parts. The remainder of 1234 ÷ 7 splits into 1200 ÷ 7 and 34 ÷ 7. The first leaves 3 (7 × 171 = 1197), the second leaves 6, and 3 + 6 = 9, which reduces to 2 after one more subtraction of 7.
- Use the power cycle for exponents. The remainder of 2¹⁰⁰ ÷ 7 follows the cycle 2, 4, 1 that repeats every 3 powers. Since 100 leaves 1 when divided by 3, the answer matches 2¹, so the remainder is 2.
- Apply the bitwise AND trick for divisors that are powers of 2. The expression
n & (2ᵏ − 1)returnsn mod 2ᵏ. Computing 77 mod 8 becomes77 & 7, which equals 5. - Reduce as you go in modular exponentiation. Multiplying, then taking the remainder at every stage, keeps the numbers small and prevents large integer overflow.
Remainders With Negative Dividends
A negative dividend produces two defensible answers, and the correct one depends on the definition being used.
Dividing −7 by 3 has two valid readings:
- Truncated division discards the decimal toward zero, giving a quotient of −2 and a remainder of −1, since 3 × (−2) = −6 and −7 − (−6) = −1.
- Floored division rounds the quotient down to −3, giving a remainder of 2, since 3 × (−3) = −9 and −7 − (−9) = 2.
Mathematicians prefer the second answer, and Euclidean division defines the remainder as non-negative for exactly this reason. The complete breakdown of why the remainder of a negative number has two answers covers every sign case. Working with mixed signed numbers therefore demands an explicit choice: use ((a % b) + b) % b in C, C++, Java or JavaScript to force a non-negative result that matches the Python convention.
When the Remainder Is Zero
A remainder of 0 means the divisor divides the dividend exactly, which makes the divisor a factor of the dividend, and the full sense of what a remainder of zero means follows from this. The statement 48 ÷ 6 = 8 remainder 0 is identical to the statement that 6 is a factor of 48.
Zero remainders drive 3 practical procedures:
- Test for prime divisors. A number n is prime when no integer from 2 up to √n leaves a remainder of 0, the basis of how to check if a number is prime. Testing 97 requires only the divisors 2, 3, 5 and 7.
- Simplify fractions. The Euclidean algorithm steps replace the pair (48, 18) with (18, 12), then (12, 6), then (6, 0). The last non-zero remainder, 6, is the greatest common divisor, and 48/18 reduces to 8/3.
- Convert between bases. Dividing 156 by 2 repeatedly and reading the remainders bottom-up yields the binary base conversion remainder string 10011100.
Dividing by zero has no remainder at all. The operation is undefined, Python raises a ZeroDivisionError, and JavaScript returns NaN.
Remainders in Modular Arithmetic
Modular arithmetic is the branch of number theory built entirely on remainders. The notation a ≡ b (mod n) states that a and b leave the same remainder when divided by n.
Clock arithmetic is the everyday case: 25 hours after 10 o’clock is 11 o’clock, since 35 leaves 11 when divided by 12. Congruence class tables group every integer by its remainder, so 3, 15 and 27 all belong to the class 3 (mod 12).
Four results extend the idea:
- Fermat’s little theorem states that a^(p−1) leaves a remainder of 1 when divided by any prime p that does not divide a.
- Euler’s theorem generalises Fermat’s little theorem to any modulus using the totient function.
- The Chinese remainder theorem reconstructs a number from its remainders. A number leaving 2 mod 3, 3 mod 5 and 2 mod 7 must be 23.
- The RSA algorithm encrypts data through modular exponentiation, which makes remainders the arithmetic core of public-key cryptography.
Remainders also power a cyclic redundancy check, where the remainder of a polynomial division detects transmission errors, and they appear in hash function design, where hash % table_size maps any key into a fixed bucket range. Deciding which of the 100! ÷ 7 style factorial calculations collapse to 0 becomes trivial once the divisor is spotted inside the factorial product.
The Remainder Theorem for Polynomials
The polynomial remainder theorem states that dividing a polynomial P(x) by (x − c) leaves a remainder equal to P(c).
Dividing P(x) = x³ − 4x + 6 by (x − 2) requires no polynomial long division. Substituting x = 2 gives P(2) = 8 − 8 + 6 = 6, so the remainder is 6.
Synthetic division reaches the same remainder with a single row of arithmetic and returns the quotient alongside it. A remainder of 0 signals that (x − c) divides P(x) exactly, which is the factor theorem, and c is a root of the polynomial.
Practice Problems
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 100 | 7 | 14 | 2 |
| 365 | 7 | 52 | 1 |
| 947 | 8 | 118 | 3 |
| 1234 | 9 | 137 | 1 |
| 45678 | 100 | 456 | 78 |
| 2¹⁰⁰ | 7 | — | 2 |
Khan Academy, Math is Fun, Brilliant.org and the Art of Problem Solving all publish graded remainder exercises for students who want timed drills after the methods make sense.
Common Mistakes
Five errors account for most wrong remainders:
- Rounding the quotient up instead of down.
- Reporting the decimal 0.75 as the remainder rather than the whole number 3.
- Returning a remainder equal to or larger than the divisor, which means the quotient was too small.
- Assuming
-7 % 3returns 2 in every language, when C and JavaScript return −1. - Trusting the calculator decimal method for dividends above 10 digits, where floating point precision fails.
Frequently Asked Questions
Can a remainder be larger than the divisor?
No, a remainder cannot be larger than the divisor. A remainder of 9 from a divisor of 4 means the divisor fits at least 2 more times, so the quotient was understated. Increase the quotient until the leftover falls below the divisor.
Can a remainder be a decimal?
No, a remainder is a whole number. Dividing 23 by 4 gives 5.75, and the 0.75 is a fractional part, not a remainder. The remainder 3 becomes the numerator of the fraction 3/4.
Is the remainder the same as the modulo?
The remainder and the modulo agree for positive numbers and diverge for negative ones. Truncated division defines the remainder, floored division defines the modulo, and −7 divided by 3 leaves −1 under the first definition and 2 under the second.
What is the remainder when a smaller number is divided by a larger one?
The remainder equals the dividend. Dividing 3 by 8 gives a quotient of 0 and a remainder of 3, since 8 fits zero whole times into 3.
How do you find the remainder of very large numbers?
Reduce the dividend modulo the divisor at every step of the calculation. Finding 2¹⁰⁰ mod 7 requires the 3-step power cycle, not the 31-digit expansion.
Conclusion
One formula does the heavy lifting: r = a − (b × q). Five methods put it to work, from subtracting the nearest multiple and long division to repeated subtraction, divisibility rules, and the modulo operator. Every problem breaks down into a dividend, divisor, quotient, and remainder, and Euclidean division promises exactly one valid answer for any positive divisor.
That same small operation confirms divisibility, squeezes large numbers into small ranges, reveals repeating cycles, and dodges decimal rounding error. Its reach runs from primary-school long division through modular arithmetic, the remainder theorem, cyclic redundancy checks, and the RSA algorithm. Punch a dividend and divisor into the Remainder Calculator and check the quotient and remainder against whatever you worked out by hand.