How this remainder calculator works
Enter a dividend and a divisor. The calculator returns Dividend % Divisor—the leftover after division. 17 % 5 = 2, because 5 × 3 + 2 = 17. 20 % 4 = 0, because 4 divides 20 exactly. The result uses toString(), so whole numbers print without forced decimal places.
The divisor must not be 0. Both fields must be finite numbers. If the non-negative dividend is smaller than the divisor, the remainder is the dividend: 7 % 17 = 7. Decimals work the same way: 10.5 % 3 = 1.5.
With negatives, the page follows JavaScript’s remainder rule: the sign of the result matches the dividend. −17 % 5 = −2. 17 % −5 = 2. That is not always the same as a school “positive remainder only” definition.
The remainder is not the quotient. For 25 and 6 the quotient is 4 and the remainder is 1. Check with Dividend = Divisor × Quotient + Remainder.