Skip to content

Math

Prime Factorization Calculator

Enter a whole number between 2 and 1,000,000 to see its prime factorization. The calculator divides by the smallest primes in order, groups repeated factors into exponents, and reports the factors, the exponent form, how many prime factors there are, and their sum.

Updated 2026-11-12 Editorial estimate Calccc Editorial Team Free · No sign-up

Loading calculator…

What this calculator does

Every whole number greater than 1 can be written as a product of primes, and that product is unique apart from order. This calculator finds the product by trial division, testing 2, then 3, then each odd number up to the square root of what remains. The result shows both the full list and a compact exponent form, which is useful for simplifying fractions, finding common denominators, and checking work by hand.

How to use it

  1. Enter a whole number from 2 to 1,000,000.
  2. Read the factor list, which shows every prime with repeats.
  3. Check the exponent form for the compact version.
  4. Review the factor count and the sum of the factors.

How it works

Divide the number by 2 as many times as it divides evenly, then by 3, then by 5, then by each odd number up to the square root of the remaining value. Every divisor that leaves no remainder is prime and is recorded. Stop when the remaining value is 1, or when it is itself prime, which becomes the final factor. Group repeats into powers: 360 = 2 x 2 x 2 x 3 x 3 x 5 = 2^3 x 3^2 x 5. The count treats repeats as separate factors, and the sum adds those same factors.

Example calculations

Example 1: 360

360 divides by 2 three times to reach 45, then by 3 twice to reach 5, so the factorization is 2^3 x 3^2 x 5. There are six prime factors, and their sum is 2 + 2 + 2 + 3 + 3 + 5 = 17.

Example 2: 97

97 is not divisible by 2, 3, 5, or 7, and 11 squared is 121, so no factor at or below the square root remains. It is prime, its factorization is 97, and it has one prime factor with a sum of 97.

Example 3: 1,024

1,024 divides by 2 ten times, so it is 2^10. It has ten prime factors, and their sum is 20.

What the result means

Trial division only needs to test divisors up to the square root, because a larger factor would pair with a smaller one already found. That is why 97 is checked against 2, 3, 5, and 7 and then declared prime. The exponent form is not a different answer; it is shorthand for repeated multiplication. Counting with repeats gives the total number of prime factors, while counting distinct primes gives how many different primes appear. The exponent form shows the distinct primes, and the count with repeats matters in some divisibility problems. Every number in range has exactly one factorization, so the answer is exact for every input.

Common mistakes

  • Treating 1 as a prime number.
  • Reporting only distinct primes when the count should include repeats.
  • Stopping at the square root of the original number but forgetting the remaining prime.
  • Trying only 2 and 3 and missing larger prime factors.
  • Entering decimals, negative numbers, or 0.

Assumptions and limits

  • The input is a whole number from 2 to 1,000,000.
  • The factor count includes repeated primes.
  • The sum adds each repeated factor separately.
  • Primality is decided by trial division, not a probabilistic test.
  • The exponent form uses the caret symbol for powers.

Frequently asked questions

Is 1 a prime number?

No. A prime has exactly two positive divisors, 1 and itself, and 1 has only one divisor. Factorizations start at 2.

What if the number is already prime?

The factorization is the number itself, the count is 1, and the sum is the number. The example 97 shows this case.

Why does the calculator stop at the square root?

If a number has a factor larger than its square root, the matching factor is smaller than the square root and would already have been found.

What is the difference between factors and prime factors?

Factors include every number that divides evenly, such as 1, 2, and 4 for 4. Prime factors are only the primes, so 4 is written as 2 x 2.

How do exponents work in the result?

2^3 means 2 x 2 x 2. The exponent counts how many times that prime appears in the factorization.

Why is the input limited to 1,000,000?

Trial division stays fast and exact in that range. Larger numbers can be factored, but they may need different methods.

Sources

This is an educational math tool. It factors whole numbers from 2 to 1,000,000 by trial division and reports exact factors and their sum. It does not handle fractions, decimals, negative numbers, or variables.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Go deeper

Guides that explain the math

Prime Factorization: Factor Trees and Divisibility
Math

Prime Factorization: Factor Trees and Divisibility

How factor trees and repeated division break a number into primes, why the answer is unique, and the divisibility rules and square-root limit that make hand factoring fast.

7 min read

Calccc Editorial Team · Updated 2026-11-12

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.