Modulo Calculator
Calculate the remainder of division (modulo operation). Find mod of any two numbers.
mod
=
?
Try:
How to Use
- Enter the dividend (the number to be divided)
- Enter the divisor (the number to divide by)
- Click "Calculate" to find the remainder
- View the quotient and verification
What is Modulo Calculator?
The modulo operation (mod) finds the remainder after division of one number by another. For example, 17 mod 5 = 2 because 17 ÷ 5 = 3 remainder 2. It's widely used in computer science, cryptography, and mathematics.
Formula
A mod B = Remainder
Verification: Quotient × B + Remainder = A
Example: 17 mod 5 = 2 (because 3 × 5 + 2 = 17)
Examples
- 17 mod 5 = 2 (17 = 3×5 + 2)
- 100 mod 7 = 2 (100 = 14×7 + 2)
- 25 mod 4 = 1 (25 = 6×4 + 1)
- 12 mod 3 = 0 (exactly divisible)
FAQ
What is modulo used for in programming?
Modulo is used to check if a number is even or odd (n % 2), to wrap around arrays (circular buffers), to limit values within a range, and in hash functions.
How does modulo work with negative numbers?
Different programming languages handle negative modulo differently. In mathematics, the result typically has the same sign as the divisor. This calculator shows both the programming result and mathematical result when they differ.
What does it mean when the result is 0?
A result of 0 means the dividend is exactly divisible by the divisor with no remainder. For example, 12 mod 4 = 0 because 12 = 3×4 exactly.