Prime Factorization Calculator
Break a number down into its prime factors with an interactive factor tree and exponential form. Add a second number to find the greatest common factor and least common multiple.
- Prime factors
- 2^3 × 3^2 × 5
- Number of factors
- 6
Calculator
Factor tree
About this calculator
This calculator breaks any whole number into its prime building blocks, shows a visual factor tree, and — when you enter a second number — computes the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of the pair. Use it to simplify fractions, find common denominators, or explore the structure of numbers.
How to read your results
The headline result shows the exponential prime factorization (for example 2³ × 3² × 5 for 360). Colored circles in the factor tree represent prime factors; open circles are the composite nodes being split. Below the tree, the GCF and LCM are listed only when you have entered a second number.
How it's calculated
Factorization uses trial division: the number is repeatedly divided by 2, then by odd integers starting at 3, up to its square root. Each divisor found is a prime factor; its exponent counts how many times it divides the number. The GCF is then computed with the Euclidean algorithm (repeatedly replacing the larger value with the remainder of dividing by the smaller), and the LCM follows from GCF × (a / GCF) × b to avoid overflow for large inputs.
Worked example
Enter 360 as the first number and 48 as the second.
360 = 2³ × 3² × 5 and 48 = 2⁴ × 3. Sharing three 2s and one 3 gives a GCF of 24. The LCM is 720 — the smallest number both divide into evenly.
Frequently asked questions
What is prime factorization?
Prime factorization is the process of writing a number as a product of prime numbers — numbers divisible only by 1 and themselves. The Fundamental Theorem of Arithmetic guarantees that every integer greater than 1 has exactly one such representation (ignoring the order of factors).
How are the GCF and LCM calculated from prime factors?
The GCF is found by multiplying each prime that appears in both factorizations, using the smaller exponent. The LCM uses each prime that appears in either factorization, using the larger exponent. For 360 = 2³ × 3² × 5 and 48 = 2⁴ × 3, the GCF is 2³ × 3 = 24 and the LCM is 2⁴ × 3² × 5 = 720.
What does it mean if my number is flagged as prime?
A prime number cannot be broken down further — its only prime factor is itself. Primes have no factor tree; they are the atoms from which all other whole numbers are built.
Sources
- mathworld.wolfram.com/PrimeFactorization.html
- www.khanacademy.org/math/cc-fourth-grade-math/imp-factors-multiples-and-patterns/imp-prime-and-composite-numbers/a/prime-factorization-review
Reviewed by the YouCalc Team · Last reviewed
Spot a translation issue, a calculation issue, or have a suggestion? Let us know.