iTutorzz

Free math tool

Prime Factorization, GCF & LCM Calculator

Find the prime factorization of any whole number up to a trillion, shown as a division ladder with exponents, whether it's prime, and all of its factors. Or enter up to six numbers for their greatest common factor (GCF) and least common multiple (LCM), worked out from the prime factors step by step - with Euclid's algorithm as a check. Free, no signup.

2 to 1,000,000,000,000

Try an example:

Prime factorization

360 = 2^3 × 3^2 × 5

Prime or composite?

Composite
24 factors in total

Number of factors

24
(3 + 1) × (2 + 1) × (1 + 1) = 24

Division ladder

360
2180
290
245
315
35
51

Divide by the smallest prime that goes in exactly, again and again, until you reach 1. The primes on the left are the prime factors.

All 24 factors

1234568910121518202430364045607290120180360

How to find a prime factorization

Divide by the smallest prime that goes in exactly (2, then 3, 5, 7, 11, ...) and repeat with the result until you reach 1. Then collect the primes you divided by:

360\displaystyle 360
=2×180=2×2×90=2×2×2×45\displaystyle = 2 \times 180 = 2 \times 2 \times 90 = 2 \times 2 \times 2 \times 45
=2×2×2×3×15=2×2×2×3×3×5\displaystyle = 2 \times 2 \times 2 \times 3 \times 15 = 2 \times 2 \times 2 \times 3 \times 3 \times 5
=23×32×5\displaystyle = 2^{3} \times 3^{2} \times 5

You only need to try primes up to the square root of the number: if nothing up to n\sqrt{n} divides n, then n is prime.

Counting factors from the prime factorization

Add one to each exponent and multiply. For 360=23×32×51360 = 2^{3} \times 3^{2} \times 5^{1} that is (3+1)(2+1)(1+1)=24(3 + 1)(2 + 1)(1 + 1) = 24 factors - each factor picks how many 2s (0 to 3), 3s (0 to 2) and 5s (0 or 1) it uses.

GCF and LCM side by side

For 12, 18 and 30:

12\displaystyle 12
=22×3,18=2×32,30=2×3×5\displaystyle = 2^{2} \times 3, \quad 18 = 2 \times 3^{2}, \quad 30 = 2 \times 3 \times 5
GCF\displaystyle \mathrm{GCF}
=2×3=6\displaystyle = 2 \times 3 = 6
LCM\displaystyle \mathrm{LCM}
=22×32×5=180\displaystyle = 2^{2} \times 3^{2} \times 5 = 180

The GCF takes the smallest power of the shared primes; the LCM takes the largest power of every prime.

Frequently asked questions

What is prime factorization?+

Writing a whole number as a product of prime numbers. Every whole number greater than 1 has exactly one prime factorization (apart from the order of the factors) - this is the Fundamental Theorem of Arithmetic. For example 360=23×32×5360 = 2^{3} \times 3^{2} \times 5.

How do you find the GCF of two numbers?+

Write both numbers as products of primes, then multiply the primes they share, each to the smallest power it has. 12=22×312 = 2^{2} \times 3 and 18=2×3218 = 2 \times 3^{2} share one 2 and one 3, so the GCF is 2×3=62 \times 3 = 6. Euclid's algorithm is a fast alternative: keep dividing and taking remainders until the remainder is 0.

How do you find the LCM?+

Multiply every prime that appears in any of the numbers, each to the largest power it has. For 12 and 18 that is 22×32=362^{2} \times 3^{2} = 36. For two numbers you can also use LCM=a×bGCF\mathrm{LCM} = \frac{a \times b}{\mathrm{GCF}}: 12×186=36\frac{12 \times 18}{6} = 36.

Is 1 a prime number?+

No. A prime has exactly two different factors, 1 and itself; 1 has only one factor. Leaving 1 out is also what makes every number's prime factorization unique.

Where are GCF and LCM used?+

The GCF simplifies fractions (1824\frac{18}{24} divides by the GCF 6 to give 34\frac{3}{4}) and splits things into equal groups. The LCM gives the least common denominator for adding fractions and answers “when will these line up again?” problems, like two buses that leave every 12 and 18 minutes meeting again after 36 minutes.

Building number sense?

Factors, multiples and primes sit under fractions, algebra and more. A math tutor can make them solid one-on-one - your first trial lesson is free.

Strong number sense, strong math

A 1-on-1 math tutor builds the foundations that make every later topic easier - your first trial lesson is free.