Prime Factorization Visualizer — Factor Tree
Animated prime factorization as a factor tree — splits a number into prime factors step by step. Runs in your browser.
Pseudocode
Run an operation to see its steps.
Avg · Worst
How to use
- 1 Type a number and press Factorize to build its factor tree.
- 2 Each step splits n into its smallest prime factor and the quotient.
- 3 The green leaves of the tree are the prime factors.
- 4 Use Random for a new number, or step through the splits.
Why use this tool
- See prime factorization as a tree: every composite splits into a prime and a quotient.
- Read the prime factorization straight off the green leaves.
- Understand the fundamental theorem of arithmetic — every integer > 1 has a unique prime factorization.
- Runs entirely in your browser. No signup, no uploads.
Frequently asked questions
What is prime factorization?
Writing a number as a product of prime numbers — for example, 60 = 2² × 3 × 5. By the fundamental theorem of arithmetic this factorization is unique.
How does the factor tree work?
Repeatedly divide the number by its smallest prime factor: that prime becomes a leaf and the quotient is factored again, until only primes remain.
How hard is factoring large numbers?
Trial division is fine for small numbers but becomes very slow for large ones. The presumed difficulty of factoring huge semiprimes is what makes RSA encryption secure.
What is a prime number?
An integer greater than 1 whose only positive divisors are 1 and itself, such as 2, 3, 5, 7, 11 — the building blocks of every other integer.
What is Prime Factorization Visualizer?
A Prime Factorization Visualizer animates a factor tree: it repeatedly splits a number into its smallest prime factor and the remaining quotient until only primes remain at the leaves, giving the unique prime factorization.
Features
Step-by-step animation
Watch each prime divide out until only 1 remains.
Complexity
Trial division: O(√n) time. Space: O(log n) for the factor list.
100% private
Runs entirely in your browser — nothing is uploaded.
Example
Input
60
Output
2 × 2 × 3 × 5 = 2² × 3 × 5
Common use cases
-
1
Factor an integer
Break a number into its prime building blocks.
-
2
GCD / LCM by factors
Use prime factorizations to compute GCD and LCM.
-
3
Understand primality
See why √n trial division suffices to factor or prove primality.
Zerethon's prime factorization visualizer animates breaking an integer into its prime factors in your browser by trial division, dividing out each prime in turn. Trial division runs in O(√n) time for a number n. Every integer greater than 1 has a unique prime factorization (the fundamental theorem of arithmetic).
- Category
- Algorithm
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
References
- Prime Factorization — Wolfram MathWorld — Wolfram MathWorld
- Integer factorization — Wikipedia
Privacy
Your data never leaves your browser unless explicitly stated. Prime Factorization Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.
New to this? Read the step-by-step explanation with Big-O analysis: Learn Number Theory →
Compare
Related tools
Bubble Sort Visualizer
Animated bubble sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs entirely in your browser.
Open toolInsertion Sort Visualizer
Animated insertion sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Open toolSelection Sort Visualizer
Animated selection sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs in your browser.
Open toolMerge Sort Visualizer
Animated merge sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.