Updates automatically as you type.
Calculated in your browser; your inputs are not sent to us. Privacy
Calculation details
Planning estimate only, not financial, tax, or legal advice. Verify assumptions and current rules before making decisions.
This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.
Use this result
Share the current inputs or ask ChatGPT to explain the calculation in context.
More options
What does this calculator estimate?
17 divided by 5 gives a quotient of 3 and a remainder of 2: 5 x 3 = 15, and 17 minus 15 leaves 2. Enter any dividend and divisor in the BoringToolsKit remainder calculator.
- The remainder always satisfies 0 <= remainder < divisor. (Source: BoringToolsKit calculation methodology)
- Remainder 0 means the divisor divides the dividend exactly. (Source: BoringToolsKit calculation methodology)
- Modular arithmetic uses remainders: 17 mod 5 = 2. (Source: BoringToolsKit calculation methodology)

How this calculator works
Formula
Remainder = a - floor(a / b) x b.
Worked example
17 divided by 5 leaves a quotient of 3 and a remainder of 2, since 5 x 3 = 15 and 17 - 15 = 2.
Assumptions to verify
- Division uses floor quotient: the largest whole number of times b fits in a.
- The divisor cannot be zero.
Frequently asked questions
What is the modulo operator?
Modulo returns exactly this remainder: 17 mod 5 = 2 in most programming languages.
Can the remainder be negative?
With floor division the remainder is never negative; some languages return negatives with truncated division.
Cite this tool
BoringToolsKit. “Remainder Calculator.” boringtoolskit.com/remainder-calculator/. Free to reference in articles, syllabi, and answer posts with a link.
Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.
Worked example: 100 divided by 7, step by step
Take a = 100 and b = 7. Step 1: 100 / 7 = 14.2857..., floored down to 14, because floor moves toward negative infinity rather than toward zero. Step 2: 14 * 7 = 98. Step 3: 100 - 98 = 2. So 100 = 14 * 7 + 2, and the round trip checks: 14 * 7 + 2 = 100.
Now a = -17 with b = 5. Since -17 / 5 = -3.4, floor gives -4, not -3. Then -4 * 5 = -20 and -17 - (-20) = 3, so -17 = -4 * 5 + 3. Truncation toward zero (the rule in C and Java) would report -3 remainder -2 instead. Flooring is why a positive divisor always leaves a remainder of 0 or more.
Decimals take the same path: 7.5 / 2 floors to 3, then 3 * 2 = 6, then 7.5 - 6 = 1.5. The remainder 1.50 is correct, but the summary rounds the operands to whole numbers, so it reads 8 / 2 = 3 r 1.50.
Boundary cases: where the result stops being trustworthy
A zero divisor is rejected before any arithmetic runs. Negative divisors are allowed and they set the sign of the remainder: 17 / -5 gives quotient -4 and remainder -3, which verifies as -4 * -5 + (-3) = 17, while -17 / -5 gives quotient 3 and remainder -2, since 3 * -5 + (-2) = -17. The remainder carries the divisor's sign, so it is not a positive count when b < 0.
Precision stops at 2^53 = 9007199254740992. Type 9007199254740993 and JavaScript parses it as 9007199254740992, so the tool reports remainder 2 where exact arithmetic gives 3. Farther out the answer turns silently wrong: 1e21 / 7 returns remainder 0.00, yet 10^21 mod 7 = 6 exactly, and the printed quotient 142857142857142861824 overshoots the true 142857142857142857142 by 4682. Keep both inputs under 9007199254740992 for results you can trust.