ThisCalculator

Technology

Divisibility Calculator: Check if a Number Divides Evenly

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Divisibility Calculator: Check if a Number Divides Evenly

A divisibility calculator checks whether one whole number divides another with no remainder. Enter the dividend and divisor to get a yes-or-no result, along with the quotient and remainder; for example, 24 is divisible by 6 because 24 ÷ 6 = 4 with remainder 0.

Formula

For a nonnegative integer dividend a and positive integer divisor b, divide a by b and find the remainder:

r = a − b × floor(a ÷ b)

The dividend a and divisor b are whole numbers with no physical units, and r is the remainder, also a whole number. The calculator reports divisible when r = 0. The quotient shown is q = floor(a ÷ b), the whole-number quotient for this nonnegative-input version. A divisor of zero is not allowed because division by zero is undefined.

Worked Example

Using the default values, a = 24 and b = 6:

  1. Calculate the whole-number quotient: floor(24 ÷ 6) = 4.
  2. Calculate the remainder: 24 − (6 × 4) = 0.
  3. Since the remainder is 0, the divisibility result is 1, meaning yes.

The result is quotient 4, remainder 0: 24 is divisible by 6.

What Divisibility Means

An integer a is divisible by a nonzero integer b when there is an integer q such that a = b × q. In other words, division leaves no fractional part and no remainder. The same relationship can be described by saying that b is a factor or divisor of a, or that a is a multiple of b.

For instance, 35 is divisible by 7 because 35 = 7 × 5. But 37 is not divisible by 7: 37 = 7 × 5 + 2, so its remainder is 2. A nonzero remainder means the division is not exact, even if a calculator displays a decimal quotient.

How to Use the Result

Enter whole numbers: put the number being tested in the Number to check field and the proposed divisor in the Divisor field. The first result is 1 for divisible and 0 for not divisible. The quotient and remainder make the result easier to verify. For the intended input range, the remainder is between 0 and b − 1.

  • Use a positive divisor. A negative divisor has the same divisibility effect as its positive counterpart, but this calculator’s stated remainder formula is designed for a positive divisor.
  • Use integer values, not rounded measurements or decimal estimates. Divisibility is a property of integers.
  • Read 1 and 0 as yes and no, respectively; they are numeric outputs chosen so the result can be handled by a calculator.

There are no unit conversions here: integers used for divisibility are counts or abstract numbers, not measurements such as inches, feet, millimeters, or meters.

Quick Divisibility Tests

For small divisors, familiar rules can often answer the question without long division. These rules are shortcuts, not different definitions; each ultimately determines whether the remainder is zero.

  • 2: An integer is divisible by 2 if its last digit is 0, 2, 4, 6, or 8.
  • 3: It is divisible by 3 if the sum of its digits is divisible by 3. For 426, the digit sum is 4 + 2 + 6 = 12, which is divisible by 3.
  • 5: It is divisible by 5 if it ends in 0 or 5.
  • 9: It is divisible by 9 if the sum of its digits is divisible by 9.
  • 10: It is divisible by 10 if it ends in 0.
  • 4: It is divisible by 4 if the number formed by its last two digits is divisible by 4. Thus, 1,316 qualifies because 16 is divisible by 4.

These shortcuts are particularly handy for mental arithmetic, while a remainder calculation works for any positive integer divisor. For larger numbers, dividing with a remainder or using a calculator is generally more convenient.

Common Mistakes and Limits

A frequent mistake is treating a rounded decimal quotient as proof of divisibility. For example, a display rounded to two decimal places may hide a small fractional part. Check the remainder or use exact integer arithmetic instead. Another mistake is confusing “divisible by” with “divides”: 3 divides 12, and 12 is divisible by 3.

The calculator expects whole-number inputs. A decimal such as 12.5 does not fit the ordinary definition of integer divisibility, and silently rounding it would change the question. Zero as the dividend is divisible by any nonzero integer because 0 = b × 0; the remainder is 0. The divisor itself cannot be zero.

The displayed quotient uses the floor operation, which is straightforward for the nonnegative dividend and positive divisor specified here. If working with negative integers, a programming language or calculator may use different conventions for quotient and remainder. The underlying divisibility test remains exact: an integer divides another when their ratio is an integer, or equivalently when an appropriate integer-multiple equation holds.

Frequently Asked Questions

How do I know if one number is divisible by another?
Divide the first integer by the second. If the remainder is 0, it is divisible; otherwise, it is not.

Is zero divisible by every number?
Zero is divisible by every nonzero integer, since zero equals that integer multiplied by zero. Division by zero is undefined, so zero cannot be the divisor.

Can a number be divisible by a negative number?
Yes. For example, 12 is divisible by −3 because 12 = (−3) × (−4). The positive and negative versions of a nonzero divisor have the same divisibility result.

Does a decimal number count as divisible?
In the standard integer-divisibility sense, the numbers being tested are integers. Decimals may be compared using other notions of exact division, but they are outside this calculator’s whole-number input definition.

What is the difference between a factor and a multiple?
If 4 divides 20, then 4 is a factor of 20 and 20 is a multiple of 4. Both statements describe the same exact division relationship from opposite directions.

Related

Formula used
in a | Number to check | - | 24 | 0
in b | Divisor | - | 6 | 1
out yes | Divisible (1=yes, 0=no) | - | (a - b * floor(a / b)) = 0 | 0
out q | Whole-number quotient | - | floor(a / b) | 0
out r | Remainder | - | a - b * floor(a / b) | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.