Divisibility Calculator
Type a number and the number you want to divide it by. The page answers yes or no, prints the quotient and the remainder, and shows the rule that decided it with the intermediate it used: 12,345 has a digit sum of 15, 15 is a multiple of 3, and 12,345 = 3 × 4,115 exactly. Under the answer every rule from 2 to 12 is worked on the same number, so you can also see that 12,345 is divisible by 5 with a quotient of 2,469, that its digit sum 15 leaves 6 over 9, and that its three-digit groups alternate to 345 minus 12, or 333, which leaves 4 over 7, the same remainder the division gives. Every intermediate on the page carries the number's own remainder, which is the reason the rules work at all. The arithmetic is done in big integers, so a number up to 1,000 digits long is divided exactly instead of being rounded through a float.
12,345 is divisible by 3: the quotient is 4,115 and the remainder is 0.
A whole number is divisible by 3 when the sum of its digits is. The division is exact, so the remainder is 0 whichever convention you use.
Every rule from 2 to 12
The same number against each small divisor, with the rule worked rather than asserted. Each intermediate carries the same remainder as the number itself: that is why the rule works, and it is the part a bare verdict leaves out.
Common questions
- How do I know if a number is divisible by 3?
- Add the digits. If the sum is a multiple of 3, so is the number, and the same sum answers 9. The page does the addition and prints it: 12,345 has a digit sum of 15, 15 is 3 × 5, so 12,345 = 3 × 4,115 exactly. That same 15 is not a multiple of 9, it leaves 6, and so does the number: 12,345 = 9 × 1,371 + 6. That is the part worth keeping. The digit sum does not only say yes or no, it carries the same remainder as the number itself.
- What is the divisibility rule for 7?
- The rule most people are taught is to double the last digit and subtract it from the rest, repeating until the number is small enough to recognise. It works, but on a long number it is a page of steps. This page uses the other standard rule, which stays one line at any length: split the number into three-digit groups from the right and alternately add and subtract them, because 1,001 is 7 × 11 × 13, so a thousand counts as minus one. For 12,345 that is 345 minus 12, which is 333, and 333 leaves 4 over 7. The division agrees: 12,345 = 7 × 1,763 + 4.
- What is the divisibility rule for 11?
- Take the digits from the right and alternately add and subtract them. For 12,345 that is 5 - 4 + 3 - 2 + 1 = 3. Three is not a multiple of 11, so neither is the number, and the remainder is 3: 12,345 = 11 × 1,122 + 3. The rule works because 10 is one less than 11, so each step along the number flips the sign. A string of ones of even length, 1,111 or a thousand ones, alternates to 0 and is always a multiple of 11.
- Why do the rules for 4 and 8 only look at the last digits?
- Because 100 is a multiple of 4 and 1,000 is a multiple of 8. Everything above the last two digits is a whole number of hundreds, so it cannot change a remainder over 4, and everything above the last three digits is a whole number of thousands, so it cannot change a remainder over 8. The page prints the digits it read: 12,345 has last two digits 45, which leave 1 over 4, and last three digits 345, which leave 1 over 8. Both of those are the number's own remainders.
- How large a number can I test?
- Up to 1,000 digits, on the number and on the divisor. The arithmetic runs in big integers rather than floating point, so nothing is rounded on the way: a 1 followed by 999 zeros is divisible by 8, and the page shows the whole quotient, 125 followed by 996 zeros. Paste something longer and the page says how many digits it counted and what the ceiling is, rather than quietly answering about a shorter number.
- How are negative numbers handled?
- The quotient is truncated toward zero, the convention programming languages use, so the remainder takes the sign of the number: -12,345 = 7 × -1,763 - 4. The page states that convention beside the result and also gives the least nonnegative remainder, the one modular arithmetic uses, which here is 3. Divisibility itself never depends on the sign: -12,345 is divisible by 3 for the same reason 12,345 is, and the digit rules read the digits either way.
- Does it find all the factors of a number?
- No. It answers the divisor you type and works every rule from 2 to 12 on your number, which settles the small factors, but it does not search for the factors of a large number. Factoring a 1,000-digit number is a different and far harder job, and a page that claimed to do it instantly would not be telling the truth. Typing a divisor larger than 12 is fine: the page divides and reports the quotient and remainder, it just has no short digit rule to show you.
- Does anything I type leave my browser?
- No. The arithmetic runs in your own browser, there is no account and nothing is uploaded. The number and the divisor are kept in this browser's storage so the page opens where you left it, and Start over at the top of the page forgets them. If your browser blocks storage the page still works, it simply opens on the example every time.
Exact integer arithmetic in big integers, so a number a thousand digits long is divided exactly rather than through a float. Beside the quotient and remainder the page prints the digit rule that applies and the intermediate it used, such as the digit sum, so you can check the rule instead of taking it on trust. The remainder convention for negative inputs is stated next to the result.