- Enter the dividend and divisor. The dividend is the number you start with. The divisor is the number you divide by. Both can be positive or negative integers or decimals. Enter 17 and 5, for example.
- Read the modulo result. For 17 mod 5, the answer is 2. This means 17 = 5 × 3 + 2. The modulo is always the non-negative remainder when the divisor is positive.
- Negative numbers. When either number is negative, different programming languages handle the result differently. JavaScript and C use truncated division (remainder can be negative). Python uses floor division (remainder is always non-negative for positive divisors). The calculator shows all three results when negative inputs are detected.
Common uses: checking if a number is even (n mod 2 = 0), wrapping around a clock (hour mod 12), cycling through array indices, and cryptography (RSA encryption relies on modular arithmetic).