Friday, November 6, 2026 · Asia/KarachiFree tools · No signup · Runs in your browser

Prime Factor Calculator

The prime factor calculator writes a whole number as a product of primes. 84 is 2 × 2 × 3 × 7. 12 is 2 × 2 × 3. Repeated factors are repeated in the line. One is refused.

New

The bound is one million. The method is trial division up to the square root, then the leftover factor if any.

How to use

  1. Enter a whole number from 2 to 1000000.
  2. Press Factor. Multiply the factors to check.
  3. Reset restores 84.

Formula / how it works

Trial division. Start at 2. Divide out every factor, then move to the next integer. Stop when the square of the candidate passes the remaining value. If the remaining value is greater than 1, it is prime and it is the last factor. 84 yields four factors. 12 yields three. A prime input yields one factor, itself. The count is the number of factors written, with repeats included. Exponents are not used. Two twos are written as two twos.

Eighty-four is 2 × 2 × 3 × 7. Twelve is 2 × 2 × 3. The repeated 2 is written twice because the factor is repeated. A prime such as 17 would be a single factor, itself. One is refused because it has no prime factors. The upper bound is one million so a slow trial does not lock the tab. The algorithm stops at the square root and then emits the leftover if it is greater than 1. That leftover is prime. You can check a small case by multiplying the factors back. If the product is not the number, the line is wrong. For 84 the product is 84. Order is ascending. The page does not print exponents. Two twos are two entries, not a square.

Multiply 2 × 2 × 3 × 7 on paper. You should get 84. Multiply 2 × 2 × 3 and you should get 12. That check is faster than re-reading the code and it catches a mis-copy from the screen. A prime such as 17 returns one line with 17 itself. That is correct, not a failure to factor. The count of 1 means the number was already prime. The count of 4 for 84 means four prime factors with repetition. If you wanted exponents, write them yourself from the repeated values. The page will not collapse them. One million is large enough for classroom numbers and small enough that the trial finishes immediately. Numbers you meet in puzzles are usually far below that.

Start with 84. Divide by 2 to get 42, divide by 2 to get 21, divide by 3 to get 7, and 7 is prime. The line is 2 × 2 × 3 × 7. Start with 12. Divide by 2 to get 6, divide by 2 to get 3, and 3 is prime. The line is 2 × 2 × 3. The page writes the factor every time it divides, so a square is two copies and a cube would be three copies. It does not print an exponent. Multiply the copies to recover the original. If the product misses, you copied a factor wrong. A prime input returns itself and a count of one. That is the definition, not an error. 1 is refused because it is not a product of primes. 0 and negatives are refused. The upper bound is one million so the trial stays short. After the loop passes the square root, any leftover greater than 1 is itself prime and is appended. That is why a large prime still appears as a single factor. Order is smallest first. The page does not sort in another order if you ask. Use the checker when you only need yes or no. Use this page when you need the list. Both share the same bound.

Count the factors on the line and multiply them in order. For 84 the four factors multiply back to 84. For 12 the three factors multiply back to 12. That product is the check.

Worked examples

Eighty-four

Inputs: Number: 84

Leave the number as 84 and press Factor. The product is 2 × 2 × 3 × 7.

Result: Number: 84 Prime factors: 2 × 2 × 3 × 7 Count: 4

Twelve

Inputs: Number: 12

Change the number to 12 and press Factor. The product is 2 × 2 × 3.

Result: Number: 12 Prime factors: 2 × 2 × 3 Count: 3

Use cases

  • Checking a factorisation by multiplying back.
  • Seeing a repeated factor written twice.
  • A prime that appears as a single factor.
  • A bound that stops at one million.

Tips & limitations

  • Multiply the factors. They should return the number.
  • One is refused.
  • Repeats are written out.
  • The list is ascending.

FAQ

Why is 84 written with two 2s?

Because 4 divides 84. Each 2 is a factor. The page does not write an exponent.

What does a prime input return?

A single factor, the number itself.

Why is 1 refused?

1 has no prime factors. The smallest input is 2.

How large can the number be?

One million. Larger values are refused so the trial stays short.

Is the leftover after the square root tested further?

If it is greater than 1 it is already prime, and it is emitted.

Is the number uploaded?

No. The trial runs in the browser.

Results are calculated from the values you enter. Double-check measurements and allow a margin before buying materials or making decisions.