Modulo Calculator
Find a remainder and quotient with exact BigInt arithmetic. A zero divisor is refused instead of divided.
Modulo Calculator
Find a remainder and quotient with exact BigInt arithmetic. A zero divisor is refused instead of divided.
How this page computes
A zero divisor is the only undefined case and is refused with the fix. Inputs are accepted up to 200 digits; past that the page states the ceiling instead of slowing the tab.
The calculation runs entirely in this browser tab; nothing is uploaded.
The page divides one whole number by another and prints the remainder and the quotient. Both are computed with BigInt, so a thirty-digit dividend is exact rather than rounded by the host's floating point.
Worked example: 17 5 gives a remainder of 2 and a quotient of 3. A divisor of zero is refused, because a remainder modulo zero does not exist, and a negative dividend keeps the remainder's sign, which the page states in a line of its own.
How to use the Modulo Calculator
Enter the dividend and the divisor, separated by a space, comma or new line, then press Run. The box takes whole numbers only: a decimal point or a letter is refused by name rather than read as zero.
The first output line is the remainder and the second is the truncated quotient, so 17 5 prints 2 and then 3. When the dividend is negative the page adds a line saying the remainder takes the dividend's sign, which is the convention BigInt's remainder operator implements.
The rule this page applies
The quotient is the integer part of the division truncated toward zero, and the remainder is dividend minus divisor multiplied by quotient. That is the pair a programming language reports, so the answer can be pasted straight into code.
A zero divisor is the only undefined case and is refused with the fix. Inputs are accepted up to 200 digits; past that the page states the ceiling instead of slowing the tab.
What to Expect
Best for
- Checking a remainder before writing a loop
- Splitting items into equal groups
- Testing a check-digit rule
Not ideal for
- Decimal or fractional remainders
- Modular inverses or modular powers
- Inputs longer than 200 digits
What this tool keeps
- Both operands, read as exact whole numbers
What may need cleanup
- Nothing: the remainder and quotient are final integers
Common errors
- A decimal point is refused, because the page takes whole numbers
- A zero divisor is refused rather than answered with infinity
Example use cases
- Check whether one number divides another
- Find the offset in a repeating cycle
Sample input
17 5
Sample output
17 mod 5 = 2 quotient = 3
Who this is for
- Students checking a division
- Programmers testing a modulo expression
Frequently asked questions
What order do the two numbers go in?
The dividend comes first and the divisor second, so 17 5 means 17 divided by 5. The output names both numbers, so the order stays visible after the run.
How are negative dividends handled?
The quotient is truncated toward zero and the remainder takes the dividend's sign, which is what JavaScript and Rust report for the same expression. The page prints a line saying so whenever the dividend is negative.
Why was a zero divisor refused?
A remainder modulo zero is undefined, so the page names the rule instead of printing a number. Enter any non-zero divisor to run it.
Is anything uploaded?
Nothing is uploaded. The numbers are read and the arithmetic runs in this browser tab with JavaScript, and reloading the page discards both the input and the result.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.