Modulo Calculator
Enter two integers to instantly compute the remainder (a mod b) with a full step-by-step breakdown.
Enter Values
mod
Quick Examples
Enter values and click Calculate
Result
=
Dividend
Divisor
Quotient
Copied to clipboard!
Step-by-step Explanation
Note on negative numbers:
This calculator uses truncated division (remainder sign follows the dividend), which matches C, Java, JavaScript, and PHP.
Python and Ruby use floored division (remainder sign follows the divisor) and may give a different result.
The floored remainder is shown in the steps above.
Summary
Enter two integers to instantly compute the remainder (a mod b) with a full step-by-step breakdown.
How it works
- Enter the dividend (a) — the number to be divided.
- Enter the divisor (b) — the number to divide by.
- Click "Calculate" or press Enter to compute a mod b.
- The result panel shows the quotient, remainder, and a full step-by-step explanation.
- Use the quick-examples buttons to explore common modulo patterns.
Use cases
- Check whether a number is even or odd (n mod 2).
- Wrap array indices or cyclic counters in programming.
- Determine divisibility of large numbers quickly.
- Compute clock arithmetic (e.g. 25 mod 12 = 1 for hours).
- Verify hash or checksum calculations by hand.
- Understand how negative-number remainders behave in different languages.
- Teach or learn the division algorithm in math courses.
- Debug modular arithmetic in cryptography exercises.
Frequently Asked Questions
Last updated: 2026-06-09 ·
Reviewed by Nham Vu