Enter an integer from 1 to 1,000,000,000,000 (10¹²) and select “Calculate.” For the complete list of divisors, use the factors calculator.
Worked example: 360 as prime factors
Write 360 as a product of primes.
- Divide by 2 as long as you can. 360 ÷ 2 = 180, 180 ÷ 2 = 90, and 90 ÷ 2 = 45. The number 45 is odd, so the 2s run out with exponent 3.
- Move on to 3. 45 ÷ 3 = 15 and 15 ÷ 3 = 5. The 3 appears twice.
- One prime is left. The 5 is divisible only by 1 and itself.
- Group the repeated factors. 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.
Result: 360 = 2³ × 3² × 5. In the result it appears as 2^3 × 3^2 × 5.
Check: 8 × 9 × 5 = 72 × 5 = 360. The result check repeats this same multiplication.
The method is always the same: try 2, then the odd numbers 3, 5, 7, 9…, and stop when the square of the candidate is larger than what is left to divide. What is left at that point is a prime.
The result does not depend on the path
You can also start with 360 = 36 × 10, then 36 = 4 × 9, 4 = 2 × 2, 9 = 3 × 3, and 10 = 2 × 5. The leaves of the tree are again three 2s, two 3s, and one 5. This is the fundamental theorem of arithmetic: the tree changes shape, but the product of prime powers is always the same. That is why you can compare the factorizations of two numbers to find their GCF (also called the GCD or HCF) or their LCM.
Prime, composite, or neither
A number is composite if it has a divisor other than 1 and itself. To decide, you do not need to test every integer: if n = a × b, one of the two factors is less than or equal to the square root of n. For 97, the root falls between 9 and 10 because 9² = 81 and 10² = 100. The primes 2, 3, 5, and 7 leave remainders 1, 1, 2, and 6, so 97 is prime. The divisibility rules rule out 2, 3, and 5 at a glance.
| Number | Factorization | What it shows |
|---|---|---|
| 97 | 97 | Prime: no prime up to 7 divides it |
| 91 | 7 × 13 | Composite that looks prime |
| 1001 | 7 × 11 × 13 | Three consecutive primes |
| 1024 | 2^10 | Power of a single prime |
| 999,999 | 3^3 × 7 × 11 × 13 × 37 | Six digits, five distinct primes |
| 1 | no factors | Neither prime nor composite |
If the list has a single factor with no exponent, the number is prime; if it has a single prime with an exponent, like 1024, the number is a power of that prime.
What you can get from the factorization
With 18 = 2 × 3² and 24 = 2³ × 3, the GCF takes each common prime with the smaller exponent, 2 × 3 = 6, and the LCM takes every prime with the larger exponent, 2³ × 3² = 72. This page does not calculate those two values; to get them directly, use the GCD calculator or the LCM calculator. With the GCF of 6, you simplify 18/24 to 3/4 in the simplify fractions tool.
The exponents also count divisors: add 1 to each one and multiply. With the exponents 3, 2, and 1 of 360, you get (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors, and the complete list is in the factors calculator. And if all the exponents are even, the number is a perfect square: 144 = 2⁴ × 3² = (2² × 3)².
How it handles large numbers
The search uses trial division. No candidate goes past the square root. At the limit of 10¹², that is about 500,000 trials at most, because only 2 and the odd numbers are tried. If a calculation takes a while, a “Cancel calculation” button appears. A number larger than 10¹² gets no verdict of prime or composite. As an example, 10¹² = 2^12 × 5^12 and 999,999,999,989 is prime.
Frequently asked questions
Why isn't 1 considered prime?
A prime has exactly two positive divisors, 1 and itself, and 1 has only one. Also, if 1 counted as prime, the factorization of 10 would not be unique: 2 × 5, 1 × 2 × 5, 1 × 1 × 2 × 5, and so on forever. That is why the list of prime factors of 1 is empty.
Can I factor a negative number, a decimal, or zero?
No, only positive integers are accepted. For a negative number, factor its absolute value and add the sign: −50 = −(2 × 5²). Zero has no factorization, because every prime divides it. For a decimal, first write it as a fraction (0.6 = 3/5) and factor the numerator and denominator separately.