Free calculator
Prime factorization calculator
Enter a whole number ≥ 2 and see its prime factors in expanded form and canonical form (p^e with ASCII carets for easy copy). Built for quick homework checks and spreadsheet prep—Google Sheets and Excel do not ship a single PRIMEFACTORS function, so the methodology shows practical patterns for small numbers.
When to use this calculator
Fast factor checks for homework, interview prep, and spreadsheet modeling when you already know the integer is modest.
- Confirm 12 = 2 × 2 × 3 or 360 = 2³ × 3² × 5 before you paste results into Sheets or Excel.
- See multiplicity (exponents) at a glance instead of hand-counting repeats in a long product.
- Grab copy-friendly canonical text for notes or code comments.
Prime factorization writes a whole number n > 1 as a product of primes, unique up to order (fundamental theorem of arithmetic). This page uses trial division: peel off 2, then test odd divisors 3, 5, 7, … up to √n.
Trial division
While d × d ≤ n, test whether d divides n. Each time it does, record d and divide n by d until it no longer divides. Increase d (after 2, only odd d are needed).
Read off the answer
Collect primes with their multiplicities (exponents). The expanded line repeats primes; the canonical line uses p^e notation in the copy-friendly view.
Worked example: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45 (three twos). 45 ÷ 3 = 15, 15 ÷ 3 = 5 (two threes). 5 is prime. So 360 = 2³ × 3² × 5.
Trial division stays fast when n is modest. The tool caps inputs at 999,999,999,999 so worst-case loops stay bounded in the browser.
For percent change and ratio checks on the same sheet, open the percentage calculator.
To sort a pasted list of numbers, open the least to greatest calculator.
For means on a pasted list, open the average calculator.
FAQs cover 0/1, negatives, GCD/LCM relationships, calculator homework tips, and limits vs big-number tools.
Google Sheets & Excel
There is no built-in array that returns prime factors for arbitrary n. For small integers you already know, list primes manually and use PRODUCT over the cells. Replace 2,2,3,5 with your factors.
=PRODUCT(2,2,3,5)Google Sheets and Excel both support PRODUCT with explicit arguments or a range like A1:A4 when each cell holds one prime factor.
=PRODUCT(POWER(2,3),POWER(3,2),5)When you already know the canonical form, POWER(base, exponent) keeps the sheet readable—verify POWER / locale equivalents with Insert function on your language pack.
More tools in Spreadsheet math
Browse all toolsSlide 1 of 14
Frequently asked questions
What is prime factorization?
It means writing an integer greater than 1 as a product of prime numbers, allowing repeats. For example 12 = 2 × 2 × 3. The list of primes is unique up to reordering.
What is the prime factorization of 1?
1 is not prime and has no prime factorization in the standard definition used in school math—there are zero primes whose product equals 1.
What about 0 or negative numbers?
This page follows the usual positive integer homework definition: 0 and 1 are excluded, and negatives are not accepted. Treat −n as −1 × n on paper if your course allows a −1 factor separately.
Is prime factorization unique?
Yes for integers > 1: apart from reordering factors, the primes and their counts (exponents) are unique. That statement is the fundamental theorem of arithmetic.
How does this relate to GCD and LCM?
Greatest common divisor (GCD) and least common multiple (LCM) are often computed from prime factorizations by taking mins/maxs of exponents on matching primes. This page focuses on one number’s factors—pairwise GCD/LCM tools are a separate workflow.
Why is there a maximum number?
The tool uses trial division in your browser. Very large composites—especially semiprimes whose factors are both huge—can require enormous work. Capping inputs keeps results snappy and predictable.
Can I check the answer with a scientific calculator?
Many calculators have FACT or factor features that return one prime factor at a time; menus differ by model. Use them as a second check—your teacher may still require written steps.
Is there a PRIMEFACTORS function in Sheets or Excel?
No universal built-in for arbitrary n. For small known factors, use PRODUCT (and POWER for exponents) as on this page. Dynamic “list all primes up to n” formulas exist but are not substitutes for a general factorization engine.
Can I use this for homework?
As a check only. Show the division ladder or factor tree if your rubric requires it—this page prints factors and exponents, not your teacher’s required layout.