Modulo Calculator
Remainder and quotient, always non-negative
Free modulo calculator — find a mod n, the quotient and the remainder for any two integers, with Euclidean modulo that never goes negative.
How to use Modulo Calculator
- Enter the dividend (the number being divided) and the divisor.
- Click Calculate Modulo.
- Read the remainder, the quotient and the division equation.
Features
- Euclidean modulo — negative dividends still give a non-negative remainder
- Quotient and remainder shown side by side
- One-click presets: 17 mod 5, 100 mod 7, -17 mod 5
- Copy the result as plain text
Frequently asked questions
What is a modulo calculator?
A modulo calculator finds the remainder when one integer is divided by another, written a mod n. For example, 17 mod 5 = 2, because 5 goes into 17 three times (5 × 3 = 15) and 2 is left over. This calculator also shows the quotient (3) and the check that proves it: 3 × 5 + 2 = 17.
How do I calculate a modulo by hand?
Divide and keep the remainder: 29 mod 7 = 1, because 7 × 4 = 28 and 29 − 28 = 1. Another: 27 mod 6 = 3, because 6 × 4 = 24 and 27 − 24 = 3. If the remainder is 0, the first number divides evenly — 496 mod 4 = 0, because 496 = 4 × 124.
What is -17 mod 5?
3. This calculator uses Euclidean modulo, so the remainder is always non-negative: -17 = -4 × 5 + 3, so the headline result is 3 and the quotient is -4. Note the two boxes can disagree with JavaScript: the Remainder box shows JavaScript's % value, -2, which pairs with the truncated quotient -3 ((-3 × 5) + (-2) = -17). The Euclidean answer, 3, is the one mathematicians and most textbooks use.
How do I check if a number is divisible?
Take it mod the other number: if the remainder is 0, it divides evenly. 496 mod 4 = 0, so 496 is divisible by 4; 226 mod 4 = 2, so it is not. The same trick tests even and odd: n mod 2 = 0 means n is even, n mod 2 = 1 means it is odd. Modulo also runs clocks: 14 mod 12 = 2, so 14:00 is 2 PM.
What is 100 mod 7?
2. 7 goes into 100 fourteen times (7 × 14 = 98) with 2 left over, so 100 mod 7 = 2 and the quotient is 14. Check: 14 × 7 + 2 = 100. This is one of the calculator's presets — click '100 mod 7' to see it worked out.
What are the limits of this calculator?
Both inputs must be integers — decimals are rejected with 'Both must be integers.' The divisor cannot be zero, and both numbers must be within 1e15 (1,000,000,000,000,000). Commas are allowed in the inputs (1,000 works). The Copy button copies the result as plain text, for example '17 mod 5 = 2.'
Login to use this free online tool. Create a free account to get started.















