Math

Modulo Calculator

Remainder after division.

Enter your values

Results update instantly as you type — no submit needed.

Results
a mod n
3
Programming remainder (a % n)
3
Quotient (floor)
6
Exact division
6.75
Divides evenly?
No

Quick answer

The modulo operation returns the remainder left after dividing one number by another.

a mod n = a − n⌊a/n⌋

How to use the Modulo Calculator

  1. 1Enter the number being divided.
  2. 2Enter the divisor.
  3. 3Compare the true modulus with the programming remainder.

Frequently asked questions

Why do negatives differ?

Most programming languages keep the sign of the dividend; mathematics returns a non-negative result.

What is modulo used for?

Clock arithmetic, hashing, cycling through lists and checking divisibility.