Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Divisibility Decision Tree


Hover any highlighted node for detailed explanation

NEven or Odd?EVEN÷2 ✓÷4?÷8?÷8 ✗ODD÷2,4,6,8,10,12 ✗↓ merge÷3?digit sum÷3 ✓÷9?÷3 ✗÷9 ✗÷5?ends 0/5÷7?÷11?alt sumDERIVED÷6(2∧3)÷10(2∧5)÷12(3∧4)
?
Enter a number to see its divisibility analysis





How to Use the Decision Tree

Enter any whole number from 1 to 9999 in the input field at the top. The tree immediately highlights the path your number follows through each divisibility test. Blue nodes indicate active tests, while gray nodes show inactive branches.

Hover your cursor over any highlighted node to reveal a tooltip explaining the specific calculation. The tooltip shows exactly why each test passes or fails for your number, including the intermediate values used in the calculation.

The summary panel on the right displays all divisors from 1 to 12 that divide your number evenly. Green badges indicate successful division, while red badges show failed tests. Click Reset to clear your input and start fresh with a new number.

Understanding the Tree Structure

The tree begins with an even/odd check at the top. This fundamental split determines which branch your number follows. Even numbers proceed left through tests for 2, 4, and 8. Odd numbers branch right and immediately eliminate all even divisors (2, 4, 6, 8, 10, 12).

Both branches merge before testing divisibility by 3. The digit sum calculation appears in the node's sublabel. From the ÷3 result, the tree splits again to test ÷9, since divisibility by 9 requires first passing ÷3.

After merging again, the tree tests ÷5 (checking the last digit), ÷7 (direct division), and ÷11 (alternating digit sum). Finally, the Derived section at the bottom shows combined results for 6, 10, and 12 based on earlier tests.

Reading the Tooltips

Each tooltip provides three pieces of information: the test name, the specific values from your number, and whether the test passes or fails.

For digit-based rules, tooltips show the actual calculation. When testing 126 for ÷3, you'll see: "Digit sum: 1+2+6 = 9. Since 9 ÷ 3 = 3, it's divisible." For position-based rules like ÷4, the tooltip displays: "Last two digits 26 ÷ 4 = 6.5 (not whole)."

Failed tests explain exactly what went wrong. If testing an odd number for ÷8, the tooltip states: "Can't be divisible by 8 without first being divisible by 4." This cascading logic helps you understand why certain paths close off.

The Even/Odd Split

Every integer is either even or odd, and this property determines divisibility by all even numbers. The tree checks the last digit: if it's 0, 2, 4, 6, or 8, the number is even; otherwise it's odd.

Even numbers automatically pass ÷2 and proceed to test ÷4 and ÷8. These tests use the last two and three digits respectively. If 4 divides the last two digits evenly, the number passes ÷4. If 8 divides the last three digits evenly, it passes ÷8.

Odd numbers take a shorter path. Since no odd number can be divisible by any even number, the tree immediately marks ÷2, ÷4, ÷6, ÷8, ÷10, and ÷12 as failed. This efficient elimination demonstrates why checking parity first saves computational effort.

Digit Sum Rules for 3 and 9

The digit sum is the sum of all individual digits in a number. For 5,274 the digit sum is 5+2+7+4=185 + 2 + 7 + 4 = 18. This simple calculation reveals divisibility by 3 and 9.

If the digit sum is divisible by 3, so is the original number. If the digit sum is divisible by 9, the original is divisible by 9. Since every multiple of 9 is also a multiple of 3, passing ÷9 guarantees passing ÷3, but not vice versa.

The tree displays the digit sum in the ÷3 node's sublabel (e.g., "sum=18"). Hovering reveals the full addition. When ÷3 passes, the tree proceeds to test whether that same digit sum also divides by 9. When ÷3 fails, ÷9 automatically fails without further calculation.

Last Digit Rules for 5 and 10

Divisibility by 5 depends entirely on the last digit. If a number ends in 0 or 5, it's divisible by 5. Any other ending digit means the number is not divisible by 5. The tree displays the last digit in the ÷5 node's sublabel.

Divisibility by 10 combines two rules: the number must be divisible by both 2 and 5. In practice, this means the number must end in 0. Ending in 5 passes ÷5 but fails ÷2, so ÷10 fails. Ending in an even digit other than 0 passes ÷2 but fails ÷5.

The derived section at the bottom shows ÷10 as "(2∧5)" indicating it requires both conditions. The tree computes this automatically from your earlier ÷2 and ÷5 results.

The Alternating Sum Rule for 11

Divisibility by 11 uses the alternating digit sum: subtract and add digits alternately from left to right. For 918,082: 91+80+82=229 - 1 + 8 - 0 + 8 - 2 = 22. Since 22 is divisible by 11, so is 918,082.

The tree computes this alternating sum and displays it in the ÷11 node's sublabel (e.g., "alt=22"). Hovering shows whether the result divides evenly by 11.

This rule works because of how place values relate to powers of 10 modulo 11. Each power of 10 alternates between +1 and -1 when reduced modulo 11, creating the alternating pattern. The result can be negative, zero, or positive—any multiple of 11 (including 0) indicates divisibility.

Derived Divisibility: 6, 10, and 12

Some divisibility tests combine simpler rules rather than using unique tests. The tree shows these as Derived results at the bottom.

Divisibility by 6 requires passing both ÷2 and ÷3. The number must be even (ends in 0,2,4,6,8) AND have a digit sum divisible by 3. Formula: (2∧3).

Divisibility by 10 requires passing both ÷2 and ÷5. Only numbers ending in 0 satisfy both conditions. Formula: (2∧5).

Divisibility by 12 requires passing both ÷3 and ÷4. The digit sum must be divisible by 3, AND the last two digits must form a number divisible by 4. Formula: (3∧4).

The derived boxes turn green or red based on combining the earlier test results, showing how composite divisibility rules build from prime and prime-power factors.

Why Divisibility Rules Work

Divisibility rules exploit patterns in our base-10 number system. Each rule connects to how powers of 10 behave when divided by specific numbers.

For ÷2 and ÷5, the last digit suffices because 10 is divisible by both. All higher place values contribute multiples of 10, leaving only the units digit to determine divisibility.

For ÷3 and ÷9, digit sums work because 101(mod3)10 \equiv 1 \pmod{3} and 101(mod9)10 \equiv 1 \pmod{9}. Each digit's contribution equals just the digit itself, regardless of its position.

For ÷4 and ÷8, the last two or three digits work because 1000(mod4)100 \equiv 0 \pmod{4} and 10000(mod8)1000 \equiv 0 \pmod{8}. Higher place values contribute nothing to the remainder.

The decision tree's structure reflects these mathematical relationships, grouping related tests and showing logical dependencies.

Related Concepts and Tools

Divisibility connects to several fundamental number theory concepts:

Prime Numbers: Numbers divisible only by 1 and themselves. If the tree shows a number divisible only by 1, it may be prime or divisible by something larger than 12.

Prime Factorization: Breaking numbers into prime factors reveals all divisibility relationships. A number is divisible by 6 because 6=2×36 = 2 × 3.

Greatest Common Divisor (GCD): The largest number dividing two integers evenly. Divisibility rules help identify shared factors quickly.

Least Common Multiple (LCM): The smallest number divisible by two given integers. Understanding divisibility simplifies LCM calculations.

Modular Arithmetic: The remainder operation generalizes divisibility. A number is divisible by nn when its remainder modulo nn equals zero.