Find all factors of any number, identify prime factors, and check primality.
Reviewed by the CalculatorKosh Editorial TeamUpdated June 2026Free ยท No sign-up
Factor Calculator
Find all factors of any number, identify prime factors, and check primality.
Enter a positive whole number
How It Works
A factor (or divisor) of a positive integer n is any integer that divides n evenly, leaving no remainder. This calculator takes any whole number from 1 to 1,000,000 and instantly lists all of its factors, groups them into factor pairs, shows the prime factorization, and tells you whether the number is prime or composite. Every positive integer has at least two factors โ 1 and itself โ and the count grows quickly for numbers rich in small divisors.
Factoring is one of the most useful skills in arithmetic and algebra. It is the engine behind simplifying fractions, finding the greatest common factor (GCF) and least common multiple (LCM), reducing surds, factoring quadratic expressions, and understanding divisibility. This tool is built for school and college students working through number-theory and algebra problems, for teachers preparing worksheets, and for anyone who needs the divisors of a number without doing the trial division by hand. The number-theory ideas it rests on also underpin modern cryptography, where the difficulty of factoring very large numbers keeps data secure.
Factors, prime, and composite
Numbers split into three groups by how many factors they have. A prime number has exactly two factors โ 1 and itself (2, 3, 5, 7, 11, 13, โฆ). A composite number has more than two factors (4, 6, 8, 9, 12, โฆ). The number 1 is special: it has only a single factor, so it is neither prime nor composite. Two is the only even prime; every other even number is divisible by 2 and therefore composite.
Factor pairs
Factors always come in pairs that multiply back to n. For 12 the pairs are 1 ร 12, 2 ร 6, and 3 ร 4. This pairing is why divisors are symmetric around the square root of n โ and why a perfect square (such as 36 = 6 ร 6) ends up with an odd number of factors, since its middle pair is the same number twice.
Prime factorization
Prime factorization expresses a number as a product of primes, for example 60 = 2ยฒ ร 3 ร 5. By the Fundamental Theorem of Arithmetic, this representation is unique for every integer greater than 1 โ there is one and only one set of primes (with their powers) that multiplies to give the number. Once you have it, a handy shortcut follows: if n = pโ^aโ ร pโ^aโ ร โฆ, the total count of factors is (aโ + 1)(aโ + 1)โฆ. For 60 = 2ยฒ ร 3ยน ร 5ยน that is (2+1)(1+1)(1+1) = 12 factors, exactly the number this calculator lists.
How factors are found
For each integer i from 1 up to the square root of n, the calculator checks whether n is divisible by i. Whenever it is, both i and n รท i are recorded as factors. Collecting divisors only up to โn and pairing each with its complement gives an efficient O(โn) algorithm, so results stay fast even near the 1,000,000 ceiling. The prime factorization is found by repeated trial division: divide out 2 as many times as possible, then 3, then 5, and so on, until what remains is 1.
Worked example
Take n = 60. Testing i from 1 to about 7.75 (โ60), the divisors found are 1, 2, 3, 4, 5, and 6, each paired with 60, 30, 20, 15, 12, and 10. Sorted, the full list of factors is 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 โ twelve in all. Repeated division gives 60 = 2 ร 2 ร 3 ร 5 = 2ยฒ ร 3 ร 5. Because the factor list is longer than two, 60 is composite.
Tips and common mistakes
- Do not list 1 and the number itself as a reason to call something prime โ a prime must haveonly those two and nothing in between.
- A factor (divisor) is different from a multiple: factors are smaller than or equal to n, multiples are greater than or equal to n.
- Treat 1 as neither prime nor composite; counting it as prime would break the uniqueness of prime factorization.
- For very large numbers beyond this calculator's 1,000,000 limit, trial division slows down and specialised methods (such as Pollard's rho or the quadratic sieve) are used instead.
Frequently Asked Questions
A factor of n is any positive integer that divides n exactly, leaving no remainder. For example, the factors of 12 are 1, 2, 3, 4, 6, and 12 โ each divides 12 evenly. Factors always come in pairs: if 3 is a factor of 12, so is 12/3 = 4.
Part of Algebra & Numbers Calculators โ compare every related calculator in one place.