Modulo Calculator
Modulo vs. remainder, and the integer quotient.
Inputs
Results
a mod b (Euclidean)3
Remainder (a % b)-2
Integer quotient-4
Everything runs locally in this browser tab. Nothing is uploaded.
How to use Modulo Calculator
Enter Dividend (a) and non-zero Divisor (b).
Compare Euclidean modulo (a mod b), signed JS remainder (a % b), and floored integer quotient.
Copy the modulo result.
Frequently asked questions
Why does −17 mod 5 give 3 instead of −2?
Signed remainder in C/JS (% operator) keeps the sign of −17 (−2), while Euclidean modulo returns the canonical remainder 3 with floor quotient −4.