Lelifi·tools

Remainder Calculator

47 divided by 5 leaves a remainder of 2, since five goes into 47 nine times and 45 comes up two short. The same division gives a quotient of 9 and a decimal answer of 9.4, and negative inputs are reported under both sign rules.

Type a dividend and a divisor. The calculator returns the quotient and the remainder, checks the division by multiplying back, and shows both sign conventions so negative numbers do not trip you up.

Enter a dividend and a divisor to get the quotient, the remainder, the decimal answer and a check that multiplies back to the number you started with.

By the Lelifi editors ·

Key takeaways

47 split into 5 groups of 9, with 2 left over5 x 9 = 452 left over45 + 2 = 47The remainder is what will not fill another whole group.Dividend 47Divisor 5Quotient 9Remainder 2The check is 5 x 9 + 2 = 47.The remainder is always smaller than the divisor. Here 2 is smaller than 5, so no further group fits.
Five groups of nine use up 45 of the 47, leaving a remainder of 2.
The same dividend, two rounding choices-50-47-45-40-47round toward zero: -9 groups, 2 shortround down: -10 groups, 3 leftDividing -47 by 5 can report a remainder of -2 or of 3, depending on which way the quotient is rounded.
Rounding -47 divided by 5 toward zero leaves -2, and rounding down leaves 3.
On this page
  1. What a remainder is
  2. Long division written as one equation
  3. Negative numbers: two conventions
  4. What the percent sign does in different languages
  5. Remainders with decimals
  6. Divisibility checks and the digit sum trick
  7. Mistakes that produce a wrong remainder

What a remainder is

Division asks how many whole copies of one number fit inside another. When they do not fit exactly, the part that is left is the remainder. In symbols, for a dividend a and a divisor b there is a quotient q and a remainder r with a = b x q + r, and r is smaller than b in size.

That last condition is what makes the answer unique. For 47 divided by 5, a quotient of 8 would leave 7, which is bigger than the divisor, so a ninth group still fits and 8 is not the quotient. A quotient of 9 leaves 2, and nothing else fits, so 9 and 2 are the pair that belongs together.

The word also shows up as modulo, and the two names describe the same operation from different angles. The remainder is the number left over, and the modulo is that number taken with a fixed sign rule. Programming languages differ on the sign rule, which is the reason this page reports more than one answer for negative inputs.

Two everyday cases: 48 eggs packed in cartons of 12 leave no remainder, and 50 eggs leave 2, because 4 cartons hold 48. A paycheck split into 3 transfers of whole dollars leaves the cents behind, and that leftover is the remainder of the division by 100.

Long division written as one equation

Every long division ends with a multiplication and a subtraction, and both fit on one line. The quotient is the number on top of the division bracket, the product of quotient and divisor is the number you subtract, and the remainder is what survives the subtraction.

Worked example: 47 divided by 5. Five goes into 47 nine times because 5 x 9 = 45, and 47 - 45 = 2. Written as one equation, 47 = 5 x 9 + 2, and the check is to multiply and add: 45 + 2 = 47. The table runs the same check on a few more pairs.

DividendDivisorQuotientRemainderCheck
475925 x 9 + 2 = 47
10071427 x 14 + 2 = 100
374914 x 9 + 1 = 37
1,024714627 x 146 + 2 = 1,024
1,000,0007142,85717 x 142,857 + 1 = 1,000,000
96128012 x 8 = 96

The fifth row is the famous repeating decimal, since 1/7 is 0.142857 and the repeating block is 142857. Multiplying that block by 7 gives 999,999, one short of a million, which is exactly the remainder of 1 the table reports.

A remainder of zero means the divisor is a factor of the dividend. That is the case in the last row, where 12 goes into 96 exactly eight times, and it is the condition every divisibility rule is built to detect.

Negative numbers: two conventions

Signs are where remainder questions get interesting. With positive numbers there is one sensible answer, but with a negative dividend or divisor there are two defensible quotients, and each carries its own remainder. Both satisfy a = b x q + r, and they differ in whether r keeps the sign of the dividend or the sign of the divisor.

DividendDivisorQuotient toward zeroRemainderQuotient rounded downRemainder
4759292
-475-9-2-103
47-5-92-10-3
-47-59-29-2

Read the second row slowly. -47 divided by 5 is -9.4. Rounding toward zero gives -9, and -47 = 5 x -9 - 2, so the remainder is -2. Rounding down gives -10, and -47 = 5 x -10 + 3, so the remainder is 3. Both statements are true, and they describe different rounding of the same division.

Rounding down is the convention that keeps the remainder non-negative when the divisor is positive, which is why clock arithmetic and hash tables use it. Rounding toward zero matches the way most people divide by hand, which is why C, Java and JavaScript do it that way. When a problem says remainder without saying which, the non-negative one is the safer reading.

What the percent sign does in different languages

In code, the remainder is usually written with a percent sign, and the operator does not behave the same everywhere. The trap shows up the first time a negative number reaches a modulo, because a loop that works in one language can shift an index by one in another.

Language or toolOperator-47 with 547 with -5Sign rule
JavaScript, C, Java, Go%-22follows the dividend
Python, Ruby%3-3follows the divisor
Excel, Google SheetsMOD3-3follows the divisor
SQL (most engines)MOD-22follows the dividend

The MDN reference for the remainder operator states the rule for JavaScript plainly: the result always takes the sign of the dividend. Python documents the other choice in its expressions chapter, where the modulo result takes the sign of the divisor.

\n

The fix is one line of arithmetic rather than a language change. To get a non-negative remainder in a language that follows the dividend, add the absolute value of the divisor and take the remainder again: (a % b + abs(b)) % abs(b). For -47 and 5 that is (-2 + 5) % 5, which comes out as 3.

Two smaller traps sit next to this one. A remainder of -0 exists in floating point and compares equal to 0, so a check written as r === -0 can behave in surprising ways. And integer division of two integers in C or Java truncates before the remainder is taken, so 7 / 2 gives 3 and 7 % 2 gives 1, never 3.5.

Remainders with decimals

Whole numbers are the usual case, but the same equation handles decimals as long as the quotient is rounded to a whole number. Take 7.5 divided by 2. Rounding the quotient down gives 3, and 7.5 - 2 x 3 leaves 1.5, so the remainder is 1.5.

That result looks odd next to the rule that a remainder is smaller than the divisor, and it is still smaller: 1.5 is less than 2. The rule survives because it compares sizes, not values, and the quotient is the largest whole number of divisors that fits.

Most school problems keep the remainder as a fraction of the divisor instead. The remainder 1.5 out of a divisor of 2 is 0.75, and adding that to the quotient gives the decimal answer of 3.75. That is the bridge between a remainder and a decimal: quotient plus remainder divided by divisor equals the exact quotient.

When a calculator shows a remainder that looks wrong for a decimal input, check whether the quotient was rounded or truncated. 7.5 divided by 2 has a decimal answer of 3.75, a quotient of 3, and a remainder of 1.5, and all three describe the same division.

Divisibility checks and the digit sum trick

A remainder of zero is a divisibility test, and the quick ones come straight from place value. A number is divisible by 2 when the last digit is even, by 5 when it ends in 0 or 5, and by 10 when it ends in 0. Those three are just the remainder of the last digit.

The digit sum rule covers 3 and 9. Because 10 leaves a remainder of 1 when divided by 9, every power of ten does the same, so a number and the sum of its digits have the same remainder when divided by 9. Take 8,741: the digits add to 20, and 20 leaves 2 when divided by 9, so 8,741 leaves 2 as well. The check confirms it, since 9 x 971 = 8,739 and 8,741 - 8,739 = 2.

The same trick answers questions about huge powers. Powers of 2 modulo 7 cycle through 2, 4 and 1 with a period of 3, because 2 cubed is 8 and 8 leaves 1. So 2 to the power 100 has the same remainder as 2 to the power 1, since 100 leaves 1 when divided by 3, and the answer is 2. No large number ever has to be written down.

Casting out nines is the everyday version of this check. Add the digits of a sum, reduce again if needed, and compare with the digit sum of the claimed answer. If the two disagree, the arithmetic is wrong somewhere. If they agree, the answer is probably right, though the check cannot catch a swap of digits that keeps the sum the same.

Mistakes that produce a wrong remainder

Four slips account for most wrong answers: rounding the quotient the wrong way, letting the remainder grow past the divisor, ignoring the sign of the divisor, and trying to divide by zero. Each leaves a signature that is easy to spot.

MistakeWhat it producesFix
Rounding the quotient up47 divided by 5 reported as 10 with a remainder of -3Use the largest whole number that still fits
Leaving a remainder larger than the divisor47 divided by 5 reported with a remainder of 7Add one to the quotient and subtract the divisor again
Ignoring a negative divisorA positive remainder when the divisor is -5Decide the sign rule before dividing
Dividing by zeroNo quotient and no remainder at allStop and report that the divisor is zero
Reading the decimal digits as a remainder9.4 reported as a remainder of 4Multiply the fractional part by the divisor: 0.4 x 5 = 2

The last row deserves a note. The 4 in 9.4 is a tenth, not a leftover count, and turning it into a remainder takes one multiplication. A decimal answer of 9.4 with a divisor of 5 means the remainder is 0.4 x 5, which is 2, exactly the number the whole number method gives.

Two checks close the loop on any answer. The remainder must be smaller than the divisor in size, and the check line must reproduce the dividend exactly. If the check line misses by the divisor, the quotient is off by one, and if it misses by a different amount, the subtraction was wrong.

Frequently asked questions

What is the remainder of 47 divided by 5?

2. Five times nine is 45, and 47 minus 45 leaves 2, so 47 = 5 x 9 + 2.

What is the remainder of 100 divided by 7?

2. Seven times fourteen is 98, and 100 minus 98 leaves 2.

What is the remainder of -47 divided by 5?

It depends on the convention. Rounding the quotient toward zero gives -2, and rounding down gives 3. Both satisfy the division equation with a different quotient.

Can a remainder be negative?

Yes, in languages and conventions that keep the sign of the dividend. In JavaScript, -47 % 5 is -2, while Python and Excel return 3 for the same division.

What is the remainder of 1,024 divided by 7?

2. Seven times 146 is 1,022, and 1,024 minus 1,022 leaves 2.

What happens when the divisor is zero?

There is no answer. No number of zero-sized groups can make a nonzero total, so the division and the remainder are both undefined.

Is the remainder the same as the modulo?

They name the same number, but the sign rule differs by language. Modulo usually refers to the non-negative result, while the remainder operator in C and JavaScript follows the dividend.

How do I turn a remainder into a decimal?

Divide the remainder by the divisor and add it to the quotient. For 47 and 5, the remainder 2 gives 2/5 = 0.4, and 9 + 0.4 = 9.4.

What is the remainder of 7.5 divided by 2?

1.5. The largest whole number of twos that fits is 3, and 7.5 minus 6 leaves 1.5.

What is the remainder of 37 divided by 4?

1. Four times nine is 36, and 37 minus 36 leaves 1, so the decimal answer is 9.25.

How can I check a remainder by hand?

Multiply the divisor by the quotient and add the remainder. For 100 and 7 that is 7 x 14 + 2, which equals 100, so the answer holds.

What is the remainder of 1,000,000 divided by 7?

1. Seven times 142,857 is 999,999, one short of a million, which is the source of the repeating decimal 0.142857.

Does a remainder of zero mean anything special?

Yes. It means the divisor divides the dividend exactly, so the divisor is a factor and the division has no leftover part.

What is 2 to the power 100 modulo 7?

2. Powers of 2 modulo 7 repeat every three steps, and 100 leaves a remainder of 1 when divided by 3, so the answer matches 2 to the power 1.

Spotted a wrong number or a broken result?

More Math tools

See all Math tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.