Skip to content
CalculatorPro — Free Online Calculators

Divisibility Test Calculator — Free Online Number Tool

Check instantly whether any number is perfectly divisible by another. Free divisibility test calculator showing the quotient, remainder, and the rule used.

ByEditorial Team, Math Updated Jun 7, 20262026 verified Methodology

Divisibility Test

About this calculator

Divisibility Test Calculator

Comprehensive Guide to Divisibility Testing

The Divisibility Test Calculator determines whether any integer is evenly divisible by a given divisor without performing tedious long division. In integer arithmetic and number theory, divisibility is the property whereby an integer $n$ divided by another integer $d$ produces an exact integer quotient $q$ with a remainder of zero ($r = 0$).

Fast divisibility algorithms take advantage of the positional base-10 structure of our numbering system and modular arithmetic congruences ($n \equiv 0 \pmod d$). Rather than executing multi-digit long division, these tests reduce multi-digit numbers to simple terminal digit checks, digital root sums, or linear digit combinations.

Mastering divisibility tests is fundamental to prime factorization, simplifying algebraic fractions, finding greatest common divisors (GCD) and least common multiples (LCM), and optimizing cryptographic algorithms such as RSA public-key key generation.


How to Use the Divisibility Test Calculator

  1. Enter the Dividend ($n$): Input the primary integer you wish to test (e.g., 4,872, 105,490, or negative integers).
  2. Select the Divisor ($d$): Choose a standard divisor (such as 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, or 13) or input an arbitrary positive integer.
  3. Select Execution Mode: Choose between single-divisor testing or comprehensive multi-divisor screening (testing divisors from 2 through 20 simultaneously).
  4. Click Calculate: Instantly view whether the integer is divisible, the exact integer quotient, the division remainder ($n \bmod d$), and the step-by-step arithmetic proof.
  5. Review the Modular Breakdown: Examine the digit-reduction technique and theoretical proof applied to your number.

The Calculator Formulas

The core condition of divisibility is defined by the Division Algorithm:

For any integers n (dividend) and d > 0 (divisor):
n = q * d + r
where:
q is the unique integer quotient (q = floor(n / d))
r is the integer remainder satisfying 0 <= r < d

n is divisible by d (written d | n) if and only if:
r = n mod d = 0

Positional base-10 integer decomposition formula:

n = d_k * 10^k + d_(k-1) * 10^(k-1) + ... + d_1 * 10^1 + d_0 * 10^0
where d_i represents each base-10 digit (0 <= d_i <= 9).

Because 10 mod 3 = 1 and 10 mod 9 = 1:
10^k mod 3 = 1^k = 1
10^k mod 9 = 1^k = 1
Therefore:
n mod 3 = (d_k + d_(k-1) + ... + d_1 + d_0) mod 3
n mod 9 = (d_k + d_(k-1) + ... + d_1 + d_0) mod 9

Alternating sum formula for divisor 11:

Because 10 mod 11 = -1:
10^k mod 11 = (-1)^k
Therefore:
n mod 11 = (d_0 - d_1 + d_2 - d_3 + ... + (-1)^k * d_k) mod 11

Composite divisor rule:

If d is composite with coprime factorization d = a * b (where gcd(a, b) = 1):
d | n  <=>  (a | n) AND (b | n)

Example for d = 6 (gcd(2, 3) = 1):
6 | n  <=>  (2 | n) AND (3 | n)

Example for d = 12 (gcd(3, 4) = 1):
12 | n <=>  (3 | n) AND (4 | n)

Practical Examples

Example 1: Testing 8,436 for Divisibility by 3, 4, and 9

Test whether $n = 8,436$ is divisible by 3, 4, and 9:

1. Test for Divisibility by 3:
   Sum of digits = 8 + 4 + 3 + 6 = 21
   Evaluate remainder: 21 mod 3 = 0
   Result: 8,436 IS divisible by 3 (8,436 / 3 = 2,812).

2. Test for Divisibility by 4:
   Examine last two digits: 36
   Evaluate remainder: 36 mod 4 = 0 (4 * 9 = 36)
   Result: 8,436 IS divisible by 4 (8,436 / 4 = 2,109).

3. Test for Divisibility by 9:
   Sum of digits = 21
   Evaluate remainder: 21 mod 9 = 3 (since 9 * 2 = 18, 21 - 18 = 3)
   Result: 8,436 IS NOT divisible by 9 (8,436 / 9 = 937 with remainder 3).

Example 2: Testing 31,482 for Divisibility by 7 and 11

1. Test for Divisibility by 7 (Truncate and Subtract Double):
   Step 1: Truncate last digit (2): 3,148 - 2*(2) = 3,148 - 4 = 3,144
   Step 2: Truncate last digit (4): 314 - 2*(4) = 314 - 8 = 306
   Step 3: Truncate last digit (6): 30 - 2*(6) = 30 - 12 = 18
   Step 4: 18 / 7 = 2 with remainder 4.
   Result: 31,482 IS NOT divisible by 7 (31,482 mod 7 = 4).

2. Test for Divisibility by 11 (Alternating Digit Sum):
   Digits from right to left: d_0=2, d_1=8, d_2=4, d_3=1, d_4=3
   Alternating sum S = d_0 - d_1 + d_2 - d_3 + d_4
                   S = 2 - 8 + 4 - 1 + 3 = 0
   Evaluate remainder: 0 mod 11 = 0
   Result: 31,482 IS divisible by 11 (31,482 / 11 = 2,862).

Key Concepts & Essential Terminology

To analyze integer relationships and test divisibility rapidly, mathematicians classify rules into four distinct modular families:

Modular Divisibility Classification SpectrumBase-10 integer reduction algorithms by positional congruence and prime factorsTERMINALLast Digit TestsDivisors: 2, 5, 10• Div by 2: Last is evend₀ ∈ {0, 2, 4, 6, 8}• Div by 5: Last is 0 or 5d₀ ∈ {0, 5}• Div by 10: Last is 0d₀ = 0Basis: 10 ≡ 0 (mod 2, 5)Powers ≥ 1 vanish mod nDIGIT SUMSDigital Root TestsDivisors: 3, 9• Div by 3: Sum of digitsΣ dᵢ mod 3 = 0• Div by 9: Sum of digitsΣ dᵢ mod 9 = 0• Cast out 9s to check4+6+8 = 18 → 1+8 = 9Basis: 10 ≡ 1 (mod 3, 9)10ᵏ ≡ 1ᵏ ≡ 1 preserves sumSUFFIX kLast k DigitsDivisors: 4, 8, 25• Div by 4: Last 2 digits(10d₁ + d₀) mod 4 = 0• Div by 8: Last 3 digits(100d₂ + ...) mod 8 = 0• Div by 25: 00, 25, 50, 75Suffix ∈ {00, 25, 50, 75}Basis: 10² = 100 ≡ 0 (mod 4)10³ = 1000 ≡ 0 (mod 8)MODULARLinear / Alt SumsDivisors: 6, 7, 11, 13• Div by 6: Div by 2 & 3n ≡ 0 mod 2 && mod 3• Div by 7: Trunc - 2·d₀(Prefix - 2·d₀) mod 7 = 0• Div by 11: Alt digit sumΣ (-1)ⁱ dᵢ mod 11 = 0Basis: 10 ≡ -1 (mod 11)1001 = 7 × 11 × 13

Figure: The 4 modular families of integer divisibility tests in base-10 positional notation.

Master Divisibility Rules Matrix (Divisors 2 through 13)

The following reference table outlines the standardized test algorithms, underlying algebraic congruence conditions, and verification criteria for common divisors:

Divisor ($d$) Test Name Operational Rule Modular Congruence Basis Example Verification ($n$)
2 Even Last Digit Last digit $d_0$ is even ($0, 2, 4, 6, 8$) $10 \equiv 0 \pmod 2$ $1,578 \rightarrow d_0 = 8$ (Divisible)
3 Digital Sum Sum of all digits is divisible by 3 $10^k \equiv 1^k \equiv 1 \pmod 3$ $453 \rightarrow 4+5+3 = 12$ (Divisible)
4 Two-Digit Suffix Last 2 digits form a number divisible by 4 $10^2 = 100 \equiv 0 \pmod 4$ $3,528 \rightarrow 28 / 4 = 7$ (Divisible)
5 Terminal 0 or 5 Last digit $d_0$ is 0 or 5 $10 \equiv 0 \pmod 5$ $9,235 \rightarrow d_0 = 5$ (Divisible)
6 Coprime Pair (2 & 3) Number is both even AND divisible by 3 $\gcd(2, 3) = 1$ $744 \rightarrow$ even, $7+4+4=15$ (Divisible)
7 Truncate & Subtract Double Subtract $2 \times d_0$ from truncated number; repeat $10 \times (-2) \equiv 1 \pmod 7$ $364 \rightarrow 36 - 2(4) = 28$ (Divisible)
8 Three-Digit Suffix Last 3 digits form a number divisible by 8 $10^3 = 1000 \equiv 0 \pmod 8$ $5,128 \rightarrow 128 / 8 = 16$ (Divisible)
9 Digital Sum Sum of all digits is divisible by 9 $10^k \equiv 1^k \equiv 1 \pmod 9$ $7,839 \rightarrow 7+8+3+9 = 27$ (Divisible)
10 Terminal Zero Last digit $d_0$ is exactly 0 $10 \equiv 0 \pmod{10}$ $4,580 \rightarrow d_0 = 0$ (Divisible)
11 Alternating Sum Alternating sum of digits $(d_0 - d_1 + d_2 - \dots)$ is div by 11 $10 \equiv -1 \pmod{11}$ $9,174 \rightarrow 4-7+1-9 = -11$ (Divisible)
12 Coprime Pair (3 & 4) Divisible by both 3 (digit sum) and 4 (last 2 digits) $\gcd(3, 4) = 1$ $1,824 \rightarrow 15$ div 3, 24 div 4 (Divisible)
13 Truncate & Add Quadruple Add $4 \times d_0$ to truncated number; repeat $10 \times 4 + 1 = 41 \equiv 2 \pmod{13}$ $832 \rightarrow 83 + 4(2) = 91 = 7 \times 13$ (Divisible)

Empirical Statistics & Computational Number Theory Benchmarks

  • Density of Divisible Integers: For any randomly chosen integer $N$, the probability that $N$ is divisible by $d$ is exactly $1/d$. Thus, 50% of all integers are divisible by 2, 33.33% by 3, 25% by 4, and 20% by 5.
  • Simultaneous Divisibility: The probability that a random integer is simultaneously divisible by $a$ and $b$ where $\gcd(a, b) = 1$ equals $1/(a \times b)$. For example, exactly $1/6$ (16.67%) of integers are divisible by both 2 and 3 (and thus divisible by 6).
  • Trial Division Complexity: In primality testing algorithms, testing divisibility up to $\sqrt{n}$ requires $O(\sqrt{n})$ operations. Using divisibility tests for small primes (2, 3, 5, 7, 11) eliminates over 76.9% of candidate composite numbers before heavy algorithmic testing begins.
  • Digital Root Cycle (Vedic Mathematics): The digital sum modulo 9 cycle repeats identically every 9 integers, forming a foundational error-checking mechanism known historically as "casting out nines."

How Divisibility Tests Work: Modular Arithmetic Mechanics

Divisibility tests are formal applications of modular congruence. In modular arithmetic, two integers $a$ and $b$ are congruent modulo $m$ (written $a \equiv b \pmod m$) if their difference $(a - b)$ is an integer multiple of $m$.

Why the Rule of 3 and 9 Works

Every positive integer in base-10 can be expanded as:

n = d_k * 10^k + d_(k-1) * 10^(k-1) + ... + d_1 * 10^1 + d_0

Notice that:

  • $10 = 9 + 1 \equiv 1 \pmod 9$ and $10 \equiv 1 \pmod 3$.
  • $100 = 99 + 1 \equiv 1 \pmod 9$.
  • $10^k = (999\dots9) + 1 \equiv 1 \pmod 9$.

Substituting $10^k \equiv 1$ into the polynomial expansion yields:

n = d_k * (1) + d_(k-1) * (1) + ... + d_1 * (1) + d_0  (mod 9)
n = Sum of digits  (mod 9)

Because $n \equiv \sum d_i \pmod 9$ and $n \equiv \sum d_i \pmod 3$, any number has the exact same remainder when divided by 3 or 9 as the sum of its individual digits.

Why the Rule of 7 and 13 Works

Rules for 7 and 13 employ linear combinations on truncated prefixes. For a number $n = 10a + b$ (where $b$ is the last digit and $a$ is the truncated prefix):

For divisor 7:
10a + b = 10a - 20b + 21b = 10(a - 2b) + 21b
Since 21b is a multiple of 7, 7 | (10a + b) <=> 7 | 10(a - 2b).
Because gcd(10, 7) = 1, this simplifies to:
7 | (10a + b) <=> 7 | (a - 2b)

For divisor 13:
10a + b = 10a + 40b - 39b = 10(a + 4b) - 39b
Since 39b is a multiple of 13, 13 | (10a + b) <=> 13 | (a + 4b).
Because gcd(10, 13) = 1, this simplifies to:
13 | (10a + b) <=> 13 | (a + 4b)

Common Divisibility Test Mistakes to Avoid

  • Applying the Digit Sum Rule to Other Numbers: Attempting to sum digits to test divisibility by 4, 6, 7, or 8. Digit summing works strictly for divisors where $10 \equiv 1 \pmod d$ (specifically 3 and 9).
  • Non-Coprime Factorization for Composite Tests: Testing divisibility by 12 by checking 2 and 6 ($2 \times 6 = 12$). Because $\gcd(2, 6) = 2 \neq 1$, a number like 18 is divisible by 2 and 6, but is NOT divisible by 12. You must always use coprime factor pairs ($\gcd(3, 4) = 1$).
  • Stopping Alternating Sums Too Early: In the divisibility test for 11, alternating signs must be applied consistently across all digits from right to left ($d_0 - d_1 + d_2 - d_3 \dots$).
  • Confusing Remainder with Divisibility: Forgetting that if a divisibility test yields a non-zero value, that value is congruent to the remainder modulo $d$, but further reduction may be required to find the true remainder between $0$ and $d - 1$.
  • Handling Negative Numbers Incorrectly: In mathematical number theory, divisibility applies symmetrically to negative integers (e.g., $-24$ is divisible by $6$ because $-24 = (-4) \times 6 + 0$).

Frequently Asked Questions

What is the divisibility rule for 7 and how do you use it?

To test if a number is divisible by 7, remove the last digit, double it, and subtract that product from the remaining truncated number. If the resulting difference is divisible by 7 (including 0, 7, -7, 14, etc.), the original number is divisible by 7. For multi-digit numbers, you can repeat this algorithm recursively until you reach a small, easily recognizable multiple of 7. For example, with 364: 36 - 2(4) = 28. Since 28 / 7 = 4, 364 is divisible by 7.

Why does the sum of digits rule only work for 3 and 9?

The sum of digits rule works because our counting system is based on powers of 10. In modular arithmetic, 10 leaves a remainder of 1 when divided by 3 (10 = 33 + 1) and when divided by 9 (10 = 91 + 1). Consequently, any power of 10 (100, 1,000, 10,000) also leaves a remainder of 1 (1^k = 1). When you decompose a number into its positional expansion, each place-value multiplier reduces to 1, leaving simply the sum of the digits.

How do you test if a large number is divisible by 11?

To test for divisibility by 11, calculate the alternating sum of its digits starting from the units place: (units digit) - (tens digit) + (hundreds digit) - (thousands digit) and so forth. If this alternating sum is a multiple of 11 (including 0, 11, -11, 22), the original number is divisible by 11. For example, for 9,174: 4 - 7 + 1 - 9 = -11. Because -11 is divisible by 11 (-11 / 11 = -1), 9,174 is divisible by 11.

What is the rule for testing composite numbers like 12, 15, and 18?

To test divisibility by a composite number, factor it into two coprime factors (numbers whose greatest common divisor is 1). The original number must pass the individual divisibility tests for both factors. For 12, test for 3 and 4 (since gcd(3,4)=1). For 15, test for 3 and 5. For 18, test for 2 and 9 (not 3 and 6, because gcd(3,6)=3).

Can zero be divided by any number?

Yes, zero is divisible by every non-zero integer. For any integer d != 0, 0 / d = 0 with a remainder of 0 (0 = 0 * d + 0). However, dividing any number by zero itself (n / 0) is mathematically undefined.

How does the divisibility test for 8 differ from 4?

Divisibility by 4 examines only the last two digits of a number, because 100 is evenly divisible by 4 (100 = 4 * 25), meaning hundreds and higher places contribute 0 to the remainder. Divisibility by 8 requires checking the last three digits, because 1,000 is the smallest power of 10 evenly divisible by 8 (1,000 = 8 * 125).


Conclusion

The Divisibility Test Calculator and its underlying modular arithmetic principles provide rapid, reliable methods for analyzing integer factorability without full division. By recognizing whether numbers belong to terminal, digital root, suffix, or linear modular families, students, programmers, and mathematicians can simplify fractions, test primality, and solve complex Diophantine equations efficiently.



Sources & References

Technical & General Calculation Disclaimer

This calculation tool applies standard mathematical, scientific, or engineering formulas. While designed for precision, output values are estimates and should be independently verified for commercial, structural, or safety-critical applications.

Comments

Sign in to leave a comment.

Loading comments…