Find the remainder of a division with our easy-to-use modulo calculator ideal for math and programming tasks.
The modulo operation, often written as X mod Y, returns the remainder when one number is divided by another. It is a foundational concept in number theory and has practical applications in fields such as cryptography, computer science, finance, and scheduling. It's a quick way to solve problems like:
In math, this operation is called "modulus" or simply "mod" The result tells you what is left after division.
Formula:
The modulo formula is: a mod b = r
Where:
So, if a = 12 and b = 5, then 12 mod 5 = 2.
Most standard calculators don’t have a dedicated “mod” button. However, scientific calculators often include it under programming or number system functions. If not, you can manually compute it using the formula: X mod Y = X - Y × floor(X ÷ Y)
To calculate X mod Y, divide X by Y, ignore the decimal part, multiply the result by Y, and subtract from X. Example: 17 mod 5 = 17 - (5 × 3) = 2
If your calculator supports it, use the mod function directly. If not, follow this manual method: Divide X by Y, Take the whole number part, Multiply it by Y , Subtract that from X and the result is your remainder (mod).