Modulus Calculator
Enter a dividend and a divisor.
About this tool
The remainder uses truncation toward zero, matching JavaScript division.
A divisor of zero is rejected.
How to use it
- Open this page and provide the input it asks for.
- Set the options that are visible, then use Divide.
- Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.
Limitations
- A divisor of zero is rejected.
Quotient by truncation, remainder by subtraction
The two lines
The dividend and the divisor are finite numbers. The quotient is the dividend divided by the divisor, with the fractional part cut off toward zero. The remainder is the dividend minus that quotient times the divisor. The panel prints the quotient and then the remainder. A divisor of zero is refused. This identity always holds when a result is shown: dividend = quotient × divisor + remainder.
Seventeen divided by five
17 / 5 is 3.4, truncation toward zero yields quotient 3, and the remainder is 17 − 3 × 5 = 2. The panel reads Quotient 3 and Remainder 2. The same rule on a negative dividend does not force a positive remainder. −17 divided by 5 truncates to −3, not to −4, and the remainder is −17 − (−3) × 5 = −2. The remainder carries the sign of the dividend. People who expected the nonnegative residue 3, the one that satisfies a modular clock, will misread that second run. The page is consistent with truncation. It is not a Euclidean modulus that always lands in 0, 1, …, |divisor| − 1.
Non-integers and the missing clock
Both boxes accept decimals. 5.5 divided by 2 truncates the quotient to 2, and the remainder is 1.5. There is no “always positive” switch and no separate modulo operator that differs from this remainder. Integers are not required, which separates this form from the gcd page. A divisor of −5 with dividend 17 truncates 17 / −5 = −3.4 toward zero to −3, and the remainder is 17 − (−3) × (−5) = 2. Check the identity before you drop the remainder into a hash or a circular buffer that assumed a nonnegative residue.
Adding the divisor to force a nonnegative residue
If a programming interface wants a remainder in 0 inclusive through |divisor| exclusive, a negative remainder from this page is not yet that residue. For dividend −17 and divisor 5, the printed remainder −2 plus the divisor 5 equals 3, and 3 is the nonnegative residue many clock problems expect. The page will not add that correction. Doing it blindly when the remainder is already nonnegative double-counts. Apply it only when the printed remainder is negative, and only when the divisor is positive.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

