Remainder and integer quotient of a ÷ b.
Free to use, no sign-up required. Modulo Calculator is one of 198 tools built into Xenition, alongside a chat that can use them for you.
Finds the remainder (a mod b) and the whole-number quotient when a is divided by b. Programmers use it for wrap-around counters and even/odd checks, and students use it for remainder problems.
The quotient is a ÷ b with the decimal part cut off (truncated toward zero), and the remainder is JavaScript’s % operator. The two always satisfy a = b × quotient + remainder. Decimals work too, and the remainder takes the sign of a.
17 mod 5 = 2 with quotient 3, because 5 × 3 = 15 and 17 − 15 = 2. For −17 and 5 the tool gives remainder −2 and quotient −3. With decimals, 7.5 mod 2 = 1.5.
There are two common conventions. This tool truncates, as JavaScript, C and Java do, so the remainder keeps the sign of a. Python and most maths texts floor instead and would give 3. Add b to a negative result to convert: −2 + 5 = 3.
A whole number is even when n mod 2 is 0. Any other result means it is odd.
You do not have to open Modulo Calculator to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.