Integer division

Remainder Calculator

Find the whole-number quotient and the amount left over, with an exact division identity and a clear rule for negative numbers.

Enter an integer and a positive divisor

The integer to divide. Positive numbers, zero, and negative numbers are accepted.

The size of each group: a positive integer greater than zero.

Up to 128 digits per number, including leading zeros. Correctly grouped commas are accepted. The remainder is always zero or positive and smaller than the divisor.

Nonnegative remainder

Enter two integers, then select Calculate.

This tool uses Euclidean division with a positive divisor. It does not evaluate decimals or expressions. The % key in the Standard Calculator continues to mean percent.

Worked examples

Packing groups

83 objects, 12 per box

83 = 12 × 6 + 11

Fill six boxes and leave 11 objects unpacked. If every object needs a box, use one more box: seven in total. The quotient counts only complete groups.

Exact division

144 divided by 12

144 = 12 × 12 + 0

The quotient is 12 and the remainder is 0. Twelve divides 144 evenly. Zero also divides evenly by any allowed divisor: 0 = 12 × 0 + 0.

Negative input

−17 divided by 5

−17 = 5 × (−4) + 3

Round the quotient down to −4, then add 3 to reach −17. Truncating the quotient toward zero would instead give −3 with remainder −2. Both identities work, but only the first has a nonnegative remainder.

Formula and chosen convention

For an integer dividend a and a positive integer divisor b, this tool finds integers q and r satisfying a = bq + r and 0 ≤ r < b. Equivalently, q = floor(a ÷ b) and r = a − bq. The division algorithm in Abstract Algebra: Theory and Applications, hosted by Dartmouth establishes that this quotient and remainder are unique under those conditions.

“Floor” means the greatest integer no larger than the exact quotient. It is not rounding to the nearest integer. For positive dividends, 17 ÷ 5 has quotient 3.4 and its floor is 3. For negative dividends, −17 ÷ 5 is −3.4 and its floor is −4.

Programming languages do not all choose the same rule for negative remainders. MDN documents JavaScript’s remainder operator: division truncates toward zero, and a nonzero remainder follows the dividend’s sign. For a negative dividend, this page displays that comparison separately. The main answer always uses the nonnegative convention above.

Integers are kept exact throughout the calculation, including values beyond JavaScript’s ordinary safe-integer range. Each field accepts at most 128 digits, counting leading zeros, and at most 256 raw characters including commas, a sign, and surrounding spaces. Use ordinary 0–9 digits, an optional keyboard + or - sign, and either no commas or groups such as 1,234,567. Internal spaces, decimal points, scientific notation, and arithmetic expressions are rejected.

Common questions

Is a remainder the same as a decimal fraction?

No. In 17 ÷ 5, the remainder is 2, while the fractional part of the positive quotient is 2/5 = 0.4. A remainder uses the dividend’s scale; divide it by the divisor to get the fractional part of the Euclidean division identity.

Why does a negative dividend give a positive remainder?

This calculator uses 0 ≤ remainder < divisor. For −1 divided by 5, the quotient is −1 and the remainder is 4, since −1 = 5 × (−1) + 4. A truncation-based calculator can show quotient 0 and remainder −1 instead. Read the stated convention when comparing tools.

Can the divisor be zero or negative?

No. Division by zero is undefined. Negative divisors can be handled under other defined conventions, but this tool requires a positive divisor so that its nonnegative remainder rule stays explicit and consistent.

Can the remainder equal the divisor?

No. If the remainder reached the divisor, one more whole group could be included in the quotient. For a divisor of 5, the only possible remainders are 0, 1, 2, 3, and 4. Dividing by 1 always leaves zero.

Does the Standard Calculator’s % key calculate a remainder?

No. On this site, the Standard Calculator uses % to turn a value into its percentage fraction, so 10% means 0.1. Use this page for integer remainders or the Percentage Calculator for percentage questions.