Free to use, no account
Modulo Calculator
Calculate the Euclidean quotient and remainder for whole numbers. Negative inputs are handled consistently, and the division identity shows how the answer is formed.
How do you calculate a modulo with a negative number?
This calculator uses a non-negative remainder smaller than the absolute divisor. For example, −7 mod 3 is 2 because −7 = (−3 × 3) + 2.
Frequently asked questions
How do you calculate a modulo with a negative number?
This calculator uses a non-negative remainder smaller than the absolute divisor. For example, −7 mod 3 is 2 because −7 = (−3 × 3) + 2.
Are my numbers uploaded?
No. The exact calculation runs in this browser. Numbers are not uploaded or saved.
What is −7 mod 3?
Using the Euclidean convention, −7 mod 3 is 2: −7 = (−3 × 3) + 2, and 0 ≤ 2 < 3.
What does congruent modulo m mean?
Two integers are congruent modulo m when their difference is divisible by |m|. The optional comparison checks this exactly.
Why can this differ from a programming language’s % operator?
Some languages keep the sign of a negative dividend in the remainder. This calculator instead returns a remainder from 0 up to, but not including, the absolute divisor.