Factor Tree & GCF / LCM Calculator
Enter one number to see its factor tree and prime factorization, or enter two numbers to find their Greatest Common Factor and Least Common Multiple. A Venn diagram shows which prime factors are shared and which are unique.
Enter one number for its factor tree, or two numbers for GCF and LCM.
Try an example
Factor Trees
Factor tree of 12
Factor tree of 18
Prime Factor Venn Diagram
Prime Factorization
GCF
6
Greatest Common Factor
LCM
36
Least Common Multiple
All Factors
12: 1, 2, 3, 4, 6, 12(6 factors)
18: 1, 2, 3, 6, 9, 18(6 factors)
Reference Guide
Prime Factorization
Every whole number greater than 1 can be written as a product of prime numbers. This is called its prime factorization.
A factor tree breaks a number down step by step. Split the number into any two factors, then keep splitting until every branch ends at a prime number.
Greatest Common Factor (GCF)
The GCF of two numbers is the largest number that divides both of them evenly. To find it using prime factorizations, multiply together the prime factors they have in common, using the smaller exponent for each.
Least Common Multiple (LCM)
The LCM of two numbers is the smallest number that both divide into evenly. To find it, multiply all prime factors from both numbers, using the larger exponent for each.
The GCF × LCM Rule
For any two numbers and , there is a useful relationship between their GCF and LCM.
For example, with 12 and 18: and . This works because the Venn diagram accounts for every prime factor exactly once.