Quotient and Remainder Calculator
Divide two whole numbers and get the quotient and remainder, with the sign rule and the check line shown.
What the quotient and remainder calculator does
It performs integer division and prints both parts: the quotient and the remainder. Division is truncated — the quotient is rounded toward zero — and the remainder is whatever is left, so it takes the sign of the dividend. The identity quotient × divisor + remainder = dividend is printed as a check line for every answer.
The sign rule is the one most programming languages use. -7 ÷ 2 gives quotient -3 and remainder -1; 7 ÷ -2 gives quotient -3 and remainder 1. That is not Euclidean division, which would force the remainder to be non-negative; the page states the convention instead of leaving it to be guessed.
Both operands are read as BigInt, so a 15-digit dividend is exact. A decimal point, an exponent, a zero divisor or more than two lines is refused with the offending value or line count named.
How to use it
Type the dividend on the first line and the divisor on the second line of the text box — one whole number per line, signs allowed.
Press Run. The result prints the dividend, the divisor, the quotient, the remainder and the check line.
Worked example
Input:
17
5
Output:
Dividend: 17
Divisor: 5
Quotient: 3 (truncated toward zero)
Remainder: 2 (same sign as the dividend)
Check: 3 × 5 + 2 = 17
Why it runs in your browser
The division is evaluated in this tab with JavaScript's own BigInt arithmetic. Neither number is sent anywhere, and nothing is stored.
Divide two whole numbers and get both parts of the answer: the quotient and the remainder.
Division is truncated, so the quotient is rounded toward zero and the remainder keeps the dividend's sign. The page prints the check line, quotient times divisor plus remainder equals dividend, for every result.
Both operands are read as BigInt, so a 15-digit dividend is exact rather than rounded by a JavaScript number.
The sign rule, stated
Integer division has more than one convention, so the page picks one and prints it. It truncates toward zero: -7 divided by 2 gives quotient -3, because -3.5 moves one step toward zero. The remainder is then whatever is left, so -7 is -3 times 2 plus -1.
That means the remainder carries the dividend's sign. 7 divided by -2 gives quotient -3 and remainder 1; -7 divided by -2 gives quotient 3 and remainder -1. Euclidean division would force a non-negative remainder and a different quotient, which is why the convention is part of the answer rather than a footnote.
A zero divisor, a decimal point, an exponent, a separator, a third line or an operand over 15 digits is refused with the offending value or count named.
How to use Quotient and Remainder Calculator
Type the dividend on the first line of the text box and the divisor on the second line, one whole number per line. A leading plus or minus is allowed.
Press Run. The result prints the dividend, the divisor, the quotient, the remainder and the check line.
If the check line does not equal the dividend you typed, stop: that is the page telling you its own arithmetic failed, not a rounding nicety.
What to Expect
Best for
- Splitting a number into equal whole groups and a remainder
- Checking the sign rule a programming language uses
- An exact answer for a dividend beyond 2^53
Not ideal for
- Decimal division: the page takes whole numbers only
- Euclidean division with a guaranteed non-negative remainder
What this tool keeps
- Both operands exactly, because the arithmetic is BigInt
- The identity q × b + r = a, printed as a check
What may need cleanup
- The sign convention is truncated division; another system may use floor division
- The 15-digit cap excludes very large cryptographic integers
Common errors
- Enter two whole numbers, one per line
- The divisor is 0
- Not a whole number: the divisor (line 2) is "2.5"
Example use cases
- Working out how many full boxes a count fills
- Checking a remainder before writing a modulo expression
Sample input
17 on the first line and 5 on the second.
Sample output
Quotient 3, remainder 2, and the check 3 × 5 + 2 = 17.
Who this is for
- Students learning integer division
- Developers checking a sign convention
Frequently asked questions
Why is the remainder negative for -7 divided by 2?
Because the quotient is truncated toward zero: -7 divided by 2 is -3 with -1 left over, and -3 times 2 plus -1 is -7. The remainder takes the dividend's sign under this convention.
Is this the same as the modulo operator?
Not always. Many languages define % as a remainder with the dividend's sign, which matches this page; others define modulo with the divisor's sign. The sign rule here is printed with the answer so you can compare.
How large can the numbers be?
Each operand may have up to 15 digits and is read as a BigInt, so the arithmetic is exact. A longer operand is refused with its digit count.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.