Divisibility Calculator

Instantly check divisibility by any integer, find all divisors, get prime factorization, and explore divisibility rules for numbers 1 through 20. A complete number theory toolkit for students, teachers, and curious minds.

Examples:
144
2520
997
1001
64
9999
1729
Privacy first: All calculations are performed locally in your browser. No data is sent to any server.Positive or negative integers up to 1012 (JavaScript safe limit).

Understanding Divisibility: A Cornerstone of Number Theory

Divisibility is a fundamental concept in arithmetic and number theory. An integer a is divisible by another integer b (with b ≠ 0) if there exists an integer k such that a = b · k. In other words, b divides a without leaving a remainder. We write this as b | a. Divisibility rules — sometimes called "divisibility tests" — are shortcuts that let you determine whether a given integer is divisible by a fixed divisor without performing the actual division.

For integers a and b ≠ 0:
b divides a  ⇔  a = b · k for some integer k  ⇔  a mod b = 0

This seemingly simple idea underpins many areas of mathematics: from elementary arithmetic and fractions to modular arithmetic, cryptography, and abstract algebra. The Divisibility Rule Calculator on this page brings these concepts to life. It not only tells you whether one number divides another, but also gives you a complete factorization, lists all divisors, and applies the classic divisibility rules for numbers 1 through 20.

Why Use a Divisibility Calculator?

  • Rapid Verification: Quickly check divisibility for large numbers without long division — perfect for homework, exams, or everyday math.
  • Factor Exploration: Instantly see all divisors of a number, which is essential for simplifying fractions, finding common denominators, and solving Diophantine equations.
  • Prime Factorization: Understand the prime building blocks of any integer — a key step in number theory, cryptography, and algorithm design.
  • Learning Tool: The interactive grid of divisibility rules (1–20) helps students internalize these shortcuts and recognize patterns in numbers.
  • Teacher Resource: Use it in the classroom to demonstrate divisibility concepts, generate examples, and engage students with visual feedback.

How the Calculation Works

When you enter an integer n, the tool performs the following steps:

  1. Validation: Ensures the input is a valid integer within the safe range (±1012).
  2. Divisor enumeration: Iterates from 1 to √n to find all divisors efficiently. Each divisor d is paired with n/d, producing the complete set.
  3. Prime factorization: Uses trial division by primes up to √n to decompose n into its prime factors with exponents.
  4. Divisibility rules: Applies the standard tests for divisors 1 through 20 (and any custom divisor you enter).
  5. Statistical summary: Computes the number of divisors, their sum, and classifies the number as prime, composite, or neither (0, 1, negative).

The algorithms used are based on elementary number theory and are optimized for performance. For numbers up to 1012, the divisor enumeration and factorization run in sub‑millisecond time in modern browsers.

Divisibility Rules at a Glance

Divisibility rules are powerful mental shortcuts. Below is a reference table for the most common divisors, which the tool also applies automatically in the results grid.

Divisor Rule Example
2 Last digit is even (0, 2, 4, 6, 8). 144 → last digit 4 → divisible.
3 Sum of digits is divisible by 3. 144 → 1+4+4=9 → divisible.
4 Last two digits form a number divisible by 4. 144 → 44 → divisible by 4.
5 Last digit is 0 or 5. 145 → last digit 5 → divisible.
6 Divisible by both 2 and 3. 144 → even and sum 9 → divisible.
7 Double the last digit and subtract from the rest; repeat. 343 → 34 − 2·3 = 28 → divisible.
8 Last three digits form a number divisible by 8. 1440 → 440 → divisible by 8.
9 Sum of digits is divisible by 9. 144 → 1+4+4=9 → divisible.
10 Last digit is 0. 1440 → divisible.
11 Alternating sum of digits is divisible by 11. 121 → (1 − 2 + 1) = 0 → divisible.
12 Divisible by both 3 and 4. 144 → divisible by 3 & 4 → divisible.
13 Four times the last digit, add to the rest; repeat. 169 → 16 + 4·9 = 52 → divisible.
17 Subtract 5 times the last digit from the rest; repeat. 221 → 22 − 5·1 = 17 → divisible.
19 Add 2 times the last digit to the rest; repeat. 361 → 36 + 2·1 = 38 → divisible.

Applications of Divisibility in Real Life

Case Study: Fair Distribution

A school has 2520 pencils to distribute equally among classrooms. Without dividing, the principal can use divisibility rules to quickly know that 2520 is divisible by 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, and many more. In fact, 2520 is the least common multiple of 1 through 10, making it a highly composite number. This property is used in scheduling, inventory management, and even in music theory (time signatures). Our calculator instantly reveals that 2520 has 48 divisors, a fact that would take minutes to compute by hand.

Case Study: Cryptography & Prime Numbers

Prime factorization is the foundation of the RSA encryption algorithm. The difficulty of factoring large numbers into primes is what makes RSA secure. While our tool works with numbers up to 1012 (for performance reasons), the same principles apply to the enormous primes used in real‑world cryptography. Understanding divisibility and factorization is the first step toward grasping modern encryption.

Common Misconceptions About Divisibility

  • “0 is divisible by everything”: Technically, 0 divided by any non‑zero integer is 0, so yes, every non‑zero integer divides 0. However, division by zero is undefined.
  • “1 is a prime number”: 1 has only one divisor (itself), so it is neither prime nor composite. The tool correctly labels it as “neither”.
  • “A number is divisible by 7 if the last digit is 7”: That's false — 17 is not divisible by 7, for example. The rule for 7 is more complex (described in the table above).
  • “Divisibility rules are only for small numbers”: Rules like those for 2, 3, 4, 5, 9, 10, and 11 work for numbers of any size. The tool applies them universally.

Step-by-Step: Using the Divisibility Calculator

  1. Enter any integer (positive or negative) into the main input field. The tool accepts numbers up to 1012.
  2. Optionally, enter a specific divisor to check divisibility for that number.
  3. Click “Analyze” or press Enter.
  4. Instantly see:
    • All positive divisors, sorted.
    • Prime factorization with exponents.
    • Divisibility status for numbers 1 through 20.
    • A custom divisibility result for your chosen divisor.
  5. Use the example buttons to explore interesting numbers like 2520 (highly composite), 997 (prime), or 1729 (Ramanujan's taxicab number).

Authoritative Background

Rooted in classical number theory — This tool is built upon the fundamental theorem of arithmetic, which states that every integer greater than 1 is either prime or can be factored uniquely into primes (up to order). The algorithms used for divisor enumeration and prime factorization are standard in computational mathematics, as described in texts such as “Elementary Number Theory” by David M. Burton and “The Art of Computer Programming” by Donald Knuth. The divisibility rules are derived from modular arithmetic and have been known since ancient times, with contributions from Euclid, Fibonacci, and many others. Reviewed by the GetZenQuery tech team, last updated June 2026.

Frequently Asked Questions

The tool works reliably for integers up to 1012 (1,000,000,000,000). This is well within the safe integer range of JavaScript (253 ≈ 9×1015), but we limit it to 1012 for performance and practicality.

Prime factorization is the process of breaking down a composite number into its prime factors. For example, 144 = 24 · 32. The tool displays the factorization in a clear, readable format, which is essential for many number theory applications.

Divisibility rules save time and mental effort. They are used in mental arithmetic, simplifying fractions, finding common denominators, solving modular arithmetic problems, and even in coding and algorithm design. They also help build intuition about the structure of numbers.

A highly composite number is a positive integer that has more divisors than any smaller positive integer. For example, 2520 has 48 divisors — more than any number less than 2520. These numbers are useful in many areas, including fraction simplification and unit conversion.

Yes. The tool accepts both positive and negative integers. Divisibility is defined for negative numbers as well: b divides a if there exists an integer k such that a = b · k. The divisors are displayed as positive values for clarity.

Excellent resources include Wolfram MathWorld, Khan Academy, and the classic text “An Introduction to the Theory of Numbers” by Hardy and Wright. For interactive learning, explore our other math tools on GetZenQuery.
References: MathWorld: Divisibility; Wikipedia: Divisibility Rule; Burton, D. M. “Elementary Number Theory” (2010).