Modulo Calculator
Find the remainder when one number is divided by another: a mod b.
How to Use Mod on a Calculator
If you've ever asked, “How do I do mod on a calculator?”, you're asking a great question. Mod (short for modulo) is one of the most useful operations in math, programming, schedules, and even everyday logic problems. In plain language, mod tells you the remainder after division.
For example, 29 mod 5 equals 4 because 5 goes into 29 five times (which gives 25),
and the leftover is 4.
Quick Definition of Mod
- Expression:
a mod b - Meaning: Remainder when
ais divided byb - Example:
17 mod 3 = 2
Method 1: Your Calculator Has a MOD Button
Many scientific calculators include a dedicated mod function. If yours does, this is the easiest path.
- Enter the first number (
a). - Press
mod. - Enter the second number (
b). - Press
=.
Example: enter 29 mod 5 = and you should get 4.
Method 2: No MOD Button? Use the Formula
If your calculator is basic and doesn't have a modulo key, you can still compute it using:
remainder = a - b × trunc(a / b)
Here, trunc means “drop the decimal part.” Some calculators call this INT or
“integer part.”
Worked Example: 137 mod 12
137 / 12 = 11.416...trunc(11.416...) = 1112 × 11 = 132137 - 132 = 5- So,
137 mod 12 = 5.
Why Mod Is So Useful
Modulo pops up in more places than most people realize:
- Time calculations: Clock math like “what time is it in 17 hours?”
- Even/odd checks:
n mod 2tells parity instantly. - Cycling patterns: Days of the week, repeating schedules, round-robin assignments.
- Programming: Array indexing, hashing, sharding, and animation loops.
- Data cleanup: Grouping records into batches or intervals.
Negative Numbers and Mod
This is where people get tripped up. Different calculators and programming languages can handle negatives differently. Some return a negative remainder, while “mathematical modulo” is often reported as non-negative.
Example with a negative value
For -13 mod 5, some systems return -3, others return 2.
Both are tied to different conventions. If you're doing schoolwork, use your teacher's definition.
If you're coding, check your language docs.
Common Mistakes to Avoid
- Trying to divide by zero. (
a mod 0is undefined.) - Confusing quotient with remainder.
- Forgetting the behavior for negative numbers can vary.
- Using rounded decimals instead of integer truncation when doing the manual method.
Quick Practice
45 mod 7 = 3100 mod 9 = 1256 mod 16 = 073 mod 10 = 3
FAQ
Is mod the same as remainder?
In everyday usage, yes. In advanced math and programming, there can be convention differences with negative numbers.
Can I use decimals in mod?
Some systems allow it and return a decimal remainder. Most classroom uses of modulo focus on integers.
What if my calculator has no INT or trunc key?
You can still estimate by finding the largest multiple of b that does not exceed a,
then subtract that multiple from a.
Final Takeaway
Modulo is simple once you frame it as “what is left over after division?” Use a MOD key when available, or use
a - b × trunc(a/b) when it isn't. Mastering this one operation makes number sense, coding logic,
and pattern problems much easier.