Math

Prime Factorization Calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a prime factorization calculator?

A prime factorization calculator takes a whole number and rewrites it as a product of prime numbers. A prime number is an integer greater than 1 whose only divisors are 1 and itself, such as 2, 3, 5, 7 and 11. Every integer greater than 1 is either prime or can be written as a unique product of primes — a result known as the Fundamental Theorem of Arithmetic. This calculator does that decomposition for you and shows the factors as digits joined by the multiplication sign, for example 60=2×2×3×560 = 2 \times 2 \times 3 \times 5.

Because the output is just digits and the multiplication symbol, it reads the same in every language.

How does it work?

The calculator uses trial division, the most direct factoring method. Starting from the smallest prime, it repeatedly divides the number by each candidate divisor for as long as the division is exact, then moves on to the next candidate:

  1. Set a divisor d=2d = 2.
  2. While the number is divisible by dd, record dd as a factor and divide the number by dd.
  3. Increase dd and repeat. You only need to test divisors up to the square root of the number, because if d×dd \times d exceeds what remains, the leftover value is itself prime.
  4. If anything greater than 1 is left over at the end, it is a prime factor too.

In formula terms, the result is the product

n=p1×p2××pkn = p_1 \times p_2 \times \cdots \times p_k

where each pip_i is prime and the primes are listed from smallest to largest, with repeats shown explicitly.

Worked examples

  • 12 divides by 2 to give 6, then by 2 again to give 3, which is prime. So 12=2×2×312 = 2 \times 2 \times 3.
  • 60 divides by 2 to give 30, by 2 again to give 15, then by 3 to give 5, which is prime. So 60=2×2×3×560 = 2 \times 2 \times 3 \times 5.
  • 17 has no divisor up to its square root (about 4.12), so it is prime and the factorization is simply 1717.
  • 100 divides by 2 twice to give 25, then by 5 twice to give 1. So 100=2×2×5×5100 = 2 \times 2 \times 5 \times 5.

Practical notes

  • The smallest input is 2, since 0, 1 and negative numbers have no prime factorization. Entering 1 or leaving the field blank returns an empty result.
  • Repeated factors are listed individually rather than as powers, so 100 appears as 2×2×5×52 \times 2 \times 5 \times 5 instead of 22×522^2 \times 5^2.
  • Prime factorization is the foundation for finding the greatest common factor and the least common multiple of two numbers: take the primes they share for the GCF, and combine all primes for the LCM. To see every divisor of a number rather than just its primes, use the factor calculator.

Report a bug

This field is required.