Dividing by with a remainder means finding the quotient (how many whole times fits into ) and the remainder (what is left over), so that . This long division calculator does it for whole numbers of any size, up to 200 digits, using exact integer arithmetic.
You get the quotient and remainder, the check , the answer as a mixed number and the exact decimal, with any repeating block in brackets (). The column method taught in school is laid out step by step: divide, multiply, subtract, bring down the next digit, repeat.
Negative numbers are where calculators and programming languages disagree, so you can choose the remainder convention: Euclidean division (the remainder is always , the mathematical standard), truncated division (the remainder has the sign of the dividend, like the % operator in C, Java and JavaScript) or floored division (the sign of the divisor, as in Python and spreadsheet MOD functions).
How to use this calculator
- Enter the dividend (the number being divided) and the divisor . Thousands separators are accepted.
- Keep the Euclidean convention unless you need to match a programming language with negative numbers.
- Read the quotient and the remainder at the top, then the check line, the mixed number and the exact decimal.
- Open the steps or the table to follow the column method digit by digit.
The formula
Division theorem. For integers and there is exactly one pair with
This is Euclidean division. For , and , written . The other conventions keep but pick a different :
| Convention | Quotient | Sign of |
|---|---|---|
| Euclidean | chosen so | never negative |
| Truncated | same as | |
| Floored | same as |
Long division builds one digit at a time: take the leading digits of as a partial dividend , write the digit , subtract , append the next digit of to the remainder, and repeat. Continuing past the decimal point with zeros gives the decimal expansion; since only remainders are possible, the digits must eventually repeat.
Worked example
7865 ÷ 23 by long division:
| Partial dividend | Quotient digit | Subtract | Remainder |
|---|---|---|---|
| 78 | 3 | 69 | 9 |
| 96 | 4 | 92 | 4 |
| 45 | 1 | 23 | 22 |
The quotient is 341 and the remainder 22: . As a mixed number, , and as a decimal (a block of 22 repeating digits).
Negative dividend, −17 ÷ 5: Euclidean gives , (since ); truncated gives , ; floored gives the same as Euclidean here because the divisor is positive.
Quotient and remainder in everyday problems
- Sharing: 7865 sweets shared among 23 classes: each gets 341 and 22 are left over.
- Packing: how many boxes of 12 for 150 eggs? , so 12 full boxes and a 13th with 6 eggs. Here you round the quotient up.
- Time: 500 minutes is , or 8 h 20 min.
- Calendars: 100 days from a Monday: , so it falls on a Wednesday.
- Divisibility: divides exactly when the remainder is 0, which is also the core step of Euclid’s algorithm in the GCD calculator.
What the remainder says about the decimal
When the remainder is 0 the division is exact. Otherwise the decimal part is . It terminates when (after removing common factors with ) has no prime factors other than 2 and 5, as with ; in every other case it repeats, with a period shorter than : repeats every 6 digits, every 22. To round a long decimal result, use the rounding calculator.
Frequently asked questions
What are the quotient and the remainder?
In a ÷ b, the quotient is the number of whole times b fits into a, and the remainder is what is left over, always smaller than b. For 17 ÷ 5 the quotient is 3 and the remainder 2, because 17 = 5 × 3 + 2.
What is Euclidean division?
It is division of integers with a remainder that is never negative: a = bq + r with 0 ≤ r < |b|. The theorem that this pair (q, r) exists and is unique goes back to Euclid’s Elements and is the basis of modular arithmetic.
Why do calculators give different remainders for negative numbers?
Because they pick a different quotient. For −17 ÷ 5, truncated division (C, Java, JavaScript %) gives q = −3, r = −2; floored and Euclidean division give q = −4, r = 3. All satisfy −17 = 5q + r. Choose the convention that matches your course or language.
How do I write a remainder as a fraction or decimal?
Divide the remainder by the divisor: 7865 ÷ 23 = 341 remainder 22, which is 341 22/23 as a mixed number, or 341.9565… as a decimal. The calculator gives both, with the repeating digits in brackets.
Can I divide decimals with long division?
Yes: multiply both numbers by the same power of 10 to make them whole, then divide. 12.6 ÷ 0.3 becomes 126 ÷ 3 = 42. The quotient is unchanged, but the remainder is scaled by that power of 10, so divide it back if you need it.
Sources
- Boute, R. T. (1992). The Euclidean definition of the functions div and mod. ACM TOPLAS 14(2), 127–144
- Knuth, D. E. The Art of Computer Programming, Vol. 1, §1.2.4 Integer Functions and Elementary Number Theory
- Leijen, D. (2003). Division and Modulus for Computer Scientists. Microsoft Research
Last updated: