Number of Divisors Calculator
The number of divisors of a whole number counts how many positive whole numbers divide it exactly, from one up to the number itself. Called the tau function, it tells you how many ways a number can be split into equal groups and underlies the distinction between prime and composite numbers. This tool counts the total divisors, the count of proper divisors (excluding the number itself), and flags whether the number is prime. It works efficiently by pairing each divisor below the square root with its matching quotient.
Number of divisors formula
Tau(N) = count of every divisor d of N (including N)
Proper divisor count = tau(N) - 1
From primes: tau = (a + 1)(b + 1)... for N = p^a * q^b ...
Here N is your number. The calculator counts divisors in pairs up to the square root, counting the square root of a perfect square only once so the total is correct.
How the divisor count works
- The divisor count includes one and the number itself.
- The proper divisor count excludes the number itself, so it is the total minus one.
- Only perfect squares have an odd number of divisors.
- A prime number has exactly two divisors; the number 1 has only one.
- The prime-factorisation rule multiplies one more than each exponent.
Number of divisors: frequently asked questions
What is the number of divisors?
The number of divisors of a whole number is the count of positive whole numbers that divide it exactly, including 1 and the number itself. The number 12 has six divisors: 1, 2, 3, 4, 6 and 12. Mathematicians call this count the tau function or the divisor-counting function.
How is the divisor count related to prime factorisation?
If a number factors into primes as p to the power a times q to the power b and so on, then its divisor count is (a + 1) times (b + 1) and so on. For 12, which is 2 squared times 3, the count is (2 + 1) times (1 + 1), equal to 6, matching the six divisors directly.
Why do only perfect squares have an odd divisor count?
Divisors normally come in pairs, one below the square root and one above, giving an even count. A perfect square has one divisor exactly equal to its square root, which pairs with itself and is counted once, making the total odd. This is why perfect squares are the only numbers with an odd number of divisors.
How does the calculator detect a prime number?
A prime number has exactly two divisors: 1 and itself. The calculator reports the divisor count, so any input with a count of two is prime. The number 1 is a special case with only one divisor and is neither prime nor composite by definition.
What inputs are valid?
The divisor count is defined for positive whole numbers. The calculator floors any decimal you enter and rejects zero and negatives. To keep the page responsive, very large inputs are capped, with the cap shown if you exceed it. It counts divisors efficiently by pairing each divisor below the square root with its quotient.
Official sources
- National Institute of Standards and Technology: Digital Library of Mathematical Functions: divisor functions.
- National Aeronautics and Space Administration: Mathematics reference.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.