What a remainder is, precisely
Divide 1,234 by 7 and you cannot land on a whole number. Seven fits 176 whole times, using up 1,232, and 2 is left over. Written as an equation:
1234 = 7 × 176 + 2
That is the shape of every division with a remainder, and the statement that it always works is the division algorithm: for any integers a and b with b ≠ 0, there is exactly one pair of integers q and r such that a = qb + r and 0 ≤ r < |b|. Both halves matter. Without the size condition on r you could write 1234 = 7 × 175 + 9, or 7 × 100 + 534, and the remainder would mean nothing. Pinning r below |b| is what makes it unique, and uniqueness is what lets an entire branch of mathematics be built on top of it.
The name “algorithm” is slightly misleading — it is a theorem about existence and uniqueness, not a procedure. Long division is the procedure that finds the pair, and it is efficient because it works one digit at a time rather than subtracting the divisor over and over.
Everything downstream depends on this. Divisibility is the statement r = 0. Modular arithmetic is the study of r on its own, which is what the modulo calculator works with. Euclid's algorithm for the greatest common factor is repeated application of the division algorithm, taking the remainder each time until it hits zero. And prime factorisation is a hunt for the divisors that leave no remainder.
How the long-division layout works
Long division processes the dividend left to right, one digit at a time, carrying the leftover forward. At each step you hold a working value, ask how many whole times the divisor fits into it, write that as the next quotient digit, subtract what it accounts for, and bring down the next digit of the dividend.
The reason it works is positional notation. When you have used up part of the dividend and carry a remainder to the next column, multiplying that remainder by ten and adding the next digit is exactly the value that remains to be divided at that place. So the digits of the quotient come out in order, most significant first, and each one is a single-digit division you can do in your head.
Two features of the layout confuse people the first time. Leading zeros in the quotient are normal when the divisor is bigger than the first few digits of the dividend: dividing 3 by 7 has a first quotient digit of 0 because 7 does not fit into 3 even once. The decimal part is not a different procedure — when the digits of the dividend run out you simply bring down zeros, which is the same as writing 1234 as 1234.0000 and continuing.
That continuation reveals whether the decimal terminates or repeats. The remainder at each step is one of the values 0, 1, …, b−1, so within b steps either the remainder hits zero and the decimal stops, or a remainder repeats and the whole block of quotient digits from that point repeats forever. This is why 1 ÷ 3 = 0.333… never ends: the remainder is 1 at every step. It is also why the repeating block of a fraction can never be longer than one less than the denominator. The fraction to decimal calculator identifies the repeating block explicitly.
Worked example: 1,234 ÷ 7, then on past the decimal point
Set up 7 outside the bracket and 1234 inside, and work the digits left to right.
- Bring down 1. Working value 1. Seven fits 0 times. Write 0, subtract 0, remainder 1.
- Bring down 2. Working value 1×10 + 2 = 12. Seven fits 1 time. Write 1, subtract 7, remainder 5.
- Bring down 3. Working value 5×10 + 3 = 53. Seven fits 7 times. Write 7, subtract 49, remainder 4.
- Bring down 4. Working value 4×10 + 4 = 44. Seven fits 6 times. Write 6, subtract 42, remainder 2.
The digits are 0, 1, 7, 6, so the quotient is 176 and the remainder is 2. Check: 7 × 176 = 1,232, and 1,232 + 2 = 1,234. ✓
Continuing past the point. The dividend's digits are exhausted, so bring down zeros.
- Working value 2×10 = 20. Seven fits 2 times. Write 2, subtract 14, remainder 6.
- Working value 60. Seven fits 8 times. Write 8, subtract 56, remainder 4.
- Working value 40. Seven fits 5 times. Write 5, subtract 35, remainder 5.
- Working value 50. Seven fits 7 times. Write 7, subtract 49, remainder 1.
So far 176.2857, and the remainders so far are 2, 6, 4, 5, 1. Two more steps give quotient digits 1 and 4 with remainders 3 and 2 — and 2 is the remainder we started the decimal part with, so the block 285714 repeats forever: 1234 ÷ 7 = 176.285714285714…
The remainder 2 as a fraction of the divisor is 2 ÷ 7 = 0.285714, which is exactly the decimal part, as it must be: a/b = q + r/b. Expressed as a percentage that is 28.5714% of one whole divisor left over.
Which answer you actually want: remainder, decimal, or rounded
The same division supports three different answers, and choosing wrongly is a modelling error rather than an arithmetic one.
Take the remainder when the things being divided cannot be split. 1,234 people into buses of 7 gives 176 full buses and 2 people who still need transport — so you need 177 buses. Notice that the useful answer here is the quotient rounded up, and the remainder is what tells you a rounding up is needed at all.
Take the decimal when the quantity is continuous. 1,234 litres shared between 7 tanks is 176.2857 litres each, and there is nothing left over because litres divide.
Take the rounded quotient when you want a representative figure. An average of 176.29 per group is a summary, not an allocation, and it should be rounded to a sensible precision rather than reported to ten places. The rounding calculator covers the tie-breaking rules.
Watch the sign convention. This calculator uses the Euclidean convention: the remainder is always in the range from 0 up to just below |b|, so −17 ÷ 5 gives quotient −4 and remainder 3, since −17 = 5(−4) + 3. Most programming languages instead truncate the quotient toward zero, giving −3 remainder −2 for the same division. Both satisfy a = qb + r; they differ in which pair they pick. Mathematics uses the non-negative one because it makes remainders line up with congruence classes; C, Java and JavaScript use the truncating one because it matches the hardware instruction. If you are checking hand work against code output, this is very often the discrepancy.
Dividing 1,234 by each small divisor, with the quick divisibility test
| Divisor d | Quick test on 1234 | Quotient | Remainder |
|---|---|---|---|
| 2 | Last digit 4 is even | 617 | 0 |
| 3 | Digit sum 1+2+3+4 = 10; 10 leaves 1 on division by 3 | 411 | 1 |
| 4 | Last two digits 34; 34 = 4×8 + 2 | 308 | 2 |
| 5 | Last digit 4, so 4 short of the next multiple | 246 | 4 |
| 6 | Even but not divisible by 3 | 205 | 4 |
| 7 | No simple test; 7×176 = 1232 | 176 | 2 |
| 8 | Last three digits 234; 8×29 = 232 | 154 | 2 |
| 9 | Digit sum 10; 10 leaves 1 on division by 9 | 137 | 1 |
| 11 | Alternating sum from the right 4−3+2−1 = 2 | 112 | 2 |
| 12 | Divisible by 4 but not by 3 | 102 | 10 |
The digit-sum tests for 3 and 9 work because 10 leaves a remainder of 1 on division by both, so every power of ten contributes its digit unchanged. The alternating-sum test for 11 works because 10 leaves a remainder of −1 on division by 11.
Where long division goes wrong
- Forgetting a zero in the quotient. When the divisor does not fit into the current working value you must still write a 0 in that place before bringing down the next digit. Skipping it shifts every later digit and multiplies the answer by ten.
- Bringing down more than one digit at a time. Each step handles exactly one digit. Pulling down two at once is a symptom of having missed a zero.
- Letting the remainder reach or exceed the divisor. If a step leaves a remainder as large as the divisor, the quotient digit was too small. The remainder at every step must be strictly less than the divisor.
- Losing the decimal point when you continue. Place the point in the quotient directly above its position in the dividend before you bring down the first zero, not afterwards.
- Reading a truncated decimal as exact. Stopping at four places gives 176.2857, but the true value continues 285714 repeating. Say which you are quoting.
- Applying the remainder to the wrong side of a real problem. A remainder of 2 people means one extra bus, not two-sevenths of a bus. Decide first whether the quantity divides.
Long division's place among the division methods
Short division is the same algorithm with the subtractions done mentally, carrying the remainder as a small digit written before the next figure of the dividend. It is faster for single-digit divisors and identical in principle; the long layout exists so the subtraction is visible and checkable.
Chunking, or partial quotients, subtracts convenient multiples of the divisor rather than insisting on the largest one at each place. Dividing 1,234 by 7 you might take 100 sevens (700), then 70 sevens (490), then 6 sevens (42), and add the chunks to get 176. It needs more writing but far less mental division, which is why many curricula teach it first. Long division is the limiting case where every chunk is the largest possible.
Polynomial long division uses the identical bookkeeping with powers of x in place of powers of ten. The division algorithm holds there too: any polynomial divided by a non-zero polynomial gives a unique quotient and a remainder of lower degree.
Two applications are worth knowing. Converting a number to another base is repeated division with remainder — the remainders, read in reverse, are the digits in the new base, which is exactly what the number base conversion calculator does. And finding every divisor of a number, as the factors calculator does, is a search for the divisions that leave remainder zero, which is why testing divisors only up to the square root suffices: past that point each new factor pairs with one already found.
