Divisibility Test Calculator with Rules and Steps

Enter any integer and nonzero divisor to get an exact yes-or-no result, quotient, remainder, and a worked divisibility rule. Inputs stay in your browser.

Enter an integer and divisor

Examples of valid input: -1_234_567, 0, and +42. Commas and spaces are not accepted inside an integer.

Divisibility result

Your result will appear here.

The starting example is divisible: 203 ÷ 7 = 29 with remainder 0.

Advertisement

What divisibility means

An integer n is divisible by a nonzero integer d when the division leaves no remainder. That means there is an integer q such that:

n = d × q + r

Divisible exactly when r = 0. This calculator reports the non-negative Euclidean remainder for |d|, so 0 ≤ r < |d|.

Signs do not change the yes-or-no test: if 84 is divisible by 7, then −84 is also divisible by 7, −7, or both. The displayed quotient keeps the entered signs when the remainder is zero.

Common divisibility rules

Rules for 2, 5, and 10

Use the last digit. It must be even for 2, be 0 or 5 for 5, and be 0 for 10.

Rules for 3 and 9

Add all digits. The original number is divisible by 3 or 9 when its digit sum is divisible by the same divisor.

Rules for 4, 8, and 16

Test only the last 2, 3, or 4 digits respectively. Earlier place values are multiples of the divisor.

Rule for 11

Take the alternating sum of the digits. The number is divisible by 11 when that sum is a multiple of 11, including 0.

Rules for 6, 12, 15, and 18

Use factor tests: 6 needs 2 and 3; 12 needs 3 and 4; 15 needs 3 and 5; 18 needs 2 and 9.

Rules for 7, 13, 17, and 19

Remove the last digit and combine it with the remaining number: subtract 2 times it for 7, add 4 times it for 13, subtract 5 times it for 17, or add 2 times it for 19. Repeat as useful.

How this calculator handles any divisor

  1. Validate both entries as exact integers and use the absolute divisor for the remainder test.
  2. Calculate the Euclidean remainder r = ((n mod |d|) + |d|) mod |d|.
  3. Report “divisible” only when r is 0, then show the exact quotient. Otherwise, show the integer quotient and non-negative remainder.
  4. For supported common divisors, explain the usual shortcut rule. For other divisors, build the remainder one digit at a time using new remainder = (old remainder × 10 + next digit) mod |d|.

Exactness and limits: JavaScript BigInt arithmetic avoids floating-point rounding. Displayed long values are shortened visually, but copied and downloaded equations retain the complete integers.

Divisibility test FAQ

What does divisible mean?

A number is divisible by a nonzero divisor when the exact remainder is 0. For example, 203 is divisible by 7 because 203 = 7 × 29.

Is zero divisible by every number?

Zero is divisible by every nonzero integer because 0 = d × 0. Division by zero is undefined, so 0 is never accepted as the divisor.

Do the rules work with negative numbers?

Yes. The shortcut test uses absolute values because signs do not affect whether the remainder is zero.

What is the divisibility rule for 7?

Remove the last digit, double it, and subtract it from the remaining leading number. Repeat if helpful. The original integer is divisible by 7 exactly when the resulting integer is divisible by 7.

What happens when there is no familiar shortcut rule?

The tool uses a general digit-by-digit remainder method. It is an exact divisibility test for every nonzero integer divisor, even when there is no convenient mental shortcut.

Why is the remainder never negative?

The calculator uses the Euclidean remainder convention, which keeps the remainder from 0 through |d| − 1. This makes results consistent for negative inputs.

Is my input private?

Yes. Validation and arithmetic happen entirely in your browser. The tool does not upload, store, or add your integers to the page URL.

Explore more tools