Prime factorization calculator
A factor tree, the division ladder and every step, for any whole number up to 10^15.
Every step in words
Factor tree
Division ladder
Divisors
Printable factor tree worksheet
The seed is drawn with crypto.getRandomValues; the numbers are then picked from it without bias (rejection sampling), primes left out. The same seed and range always give the same sheet, so a class can share one.
How to use it
- Type a whole number from 2 to 10^15. Spaces and thousands commas are fine (1,000,000), and so is a power such as 2^49.
- Read the answer at the top: exponent form (2³ × 3² × 5), the full product of primes, and the number of divisors with the formula behind it.
- Pick how the tree splits. Smallest prime first peels off one prime at a time, matching the ladder. Two nearest factors splits like a person would by eye (60 → 6 × 10, 1001 → 13 × 77).
- Read every step in words under the drawings, or tap Copy steps as text to paste them into homework notes.
- Download the tree as PNG or SVG, or tap Print for the tree, the ladder and the steps on paper.
- For practice, choose 6, 9 or 12 trees and a range, then Print sheet + answers: page one has blank trees, page two the factor trees and answers.
What it cannot do
- Numbers above 10^15 (1,000,000,000,000,000) are refused, not rounded. Every number it accepts is factored exactly.
- No negative numbers, fractions or decimals. Only whole numbers from 2 up have a prime factorization; for −360, factor 360 and write −1 × in front.
- It is not a GCF or LCM calculator. You can read both off two factorizations (lowest powers of the shared primes for the GCF, highest powers of every prime for the LCM), but this page factors one number at a time.
- The divisor list stops at 2,000 divisors. The count and its formula are always shown; 963,761,198,400 has 6,720 divisors, too many to list.
- Practice sheets use numbers from 4 to 100,000 and leave out primes.
- Nothing is saved and nothing you type is sent anywhere; the number stays in this page.
Questions
How do you find the prime factorization of a number?
Divide by the smallest prime that goes in exactly, and keep dividing the answer the same way until you reach 1. 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5, ÷ 5 = 1. The primes you divided by are the factorization: 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5. You only need to try primes up to the square root of what is left: if nothing up to √n divides it, what is left is prime.
How do you make a factor tree?
Write the number at the top and split it into any two factors, such as 60 = 6 × 10. Split every factor that is not prime again (6 = 2 × 3, 10 = 2 × 5) and circle each prime. When every branch ends in a circle, the circled numbers multiplied together give the number back: 60 = 2² × 3 × 5. Any first split gives the same primes; that is the fundamental theorem of arithmetic. Switch between the two split choices above to see two different trees with the same leaves.
What is the division method (ladder method)?
The same repeated division, written as an upside-down division: the number on the right, the prime you divide by on the left, the answer underneath, until the bottom row is 1. Some schools call it the ladder, the cake method or upside-down division. The column of primes down the left side is the prime factorization, already in order from smallest to largest.
How many divisors does a number have?
Add 1 to each exponent and multiply. 360 = 2³ × 3² × 5¹ has (3 + 1)(2 + 1)(1 + 1) = 24 divisors, because each divisor picks 0 to 3 twos, 0 to 2 threes and 0 or 1 five. A prime always has exactly 2 divisors, 1 and itself, and a number has an odd count only when it is a perfect square.
Can it factor large numbers?
Up to 10^15, exactly. 600851475143 = 71 × 839 × 1471 × 6857 comes back at once, and 10^15 = 2^15 × 5^15. A 15-digit prime such as 999,999,999,999,989 takes up to about half a second, because every possible factor up to its square root, about 31.6 million, has to be ruled out. Beyond 10^15 that check gets too slow for a page, so the box stops there.