Every number is built from primes
A prime number has exactly two divisors: 1 and itself (2, 3, 5, 7, 11…). The fundamental theorem of arithmetic says every whole number above 1 can be written as a product of primes in exactly one way. That factorization is the key to simplifying fractions and roots, finding the GCF and LCM, and counting divisors.
Worked example
360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45 (three 2s); 45 ÷ 3 = 15, ÷ 3 = 5 (two 3s); 5 is prime. So 360 = 2³ × 3² × 5. A factor tree drawn by hand ends at the same primes.
Counting divisors
Add 1 to each exponent and multiply: (3 + 1) × (2 + 1) × (1 + 1) = 24. So 360 has 24 divisors, which is one reason the Babylonians liked it for circles and calendars.
How this works
The page divides the number by 2 as many times as it can, then tries 3, 5, 7 and every odd number after that, up to the square root of what remains. Each time a divisor fits, it is recorded and divided out. Whatever is left at the end, if larger than 1, is itself prime. The factors are written with exponents and also expanded, and the number of divisors is the product of each exponent plus one. Numbers up to 10^15 are supported and the arithmetic stays exact.
Frequently asked
Is 1 a prime number?
No. A prime has exactly two divisors, and 1 has only one.
What is the largest number I can factor here?
10^15 (a quadrillion). Larger numbers need specialised algorithms.
How is the number of divisors calculated?
Multiply together each prime's exponent plus one: 2³ × 3² × 5 gives 4 × 3 × 2 = 24 divisors.
What is a factor tree?
A diagram that splits a number into two factors repeatedly until only primes remain. It reaches the same primes shown here.
Sources
Reviewed Oct 17, 2026 · test vectors fixtures/calculators/math/prime-factorization/