Prime Factorization Calculator

Break a whole number greater than 1 into the primes that multiply to make it, written in exponent form — or find out that it is prime.

StepsExact resultVerifiedLocal only

Calculator

  • Trial division to √n
  • Exponent form
  • Primality detection
  • Product proof

Result & calculation receipt

Result2^3 × 3^2 × 5
Calculation receipt
Method
Trial division by ascending primes
Formula
n = p₁^a₁ × p₂^a₂ × … (unique prime factorization)
Substitution
360 = 2^3 × 3^2 × 5
Steps
  1. 360 ÷ 2 = 180
  2. 180 ÷ 2 = 90
  3. 90 ÷ 2 = 45
  4. 45 ÷ 3 = 15
  5. 15 ÷ 3 = 5
  6. 5 is prime — stop.
Verification
Product check: 2 × 2 × 2 × 3 × 3 × 5 = 360 = 360
Exact result
2^3 × 3^2 × 5
Decimal result
360
Engine
math-solvers v1.4.0

How this calculator works

The calculator divides by 2, then by ascending odd numbers, peeling off each prime factor as many times as it divides. It only needs to test divisors up to the square root of the remaining number; if nothing divides it, what is left is prime. Repeated factors are collected into exponent notation, and the factors are multiplied back to prove they recover the original number.

Worked example

For 360 the calculator divides by 2 three times (360 → 180 → 90 → 45), then by 3 twice (45 → 15 → 5), then by 5 once, giving 2³ × 3² × 5. The product check multiplies these back: 8 × 9 × 5 = 360. For 97 no divisor up to √97 ≈ 9.8 works, so it is reported as prime.

Key insight

Every integer above 1 has exactly one prime factorization — the Fundamental Theorem of Arithmetic. That uniqueness is what makes prime factorization the backbone of finding GCFs and LCMs, simplifying radicals, and the number theory behind modern cryptography.

Frequently asked questions

What is prime factorization?

It is writing a number as a product of prime numbers, such as 360 = 2³ × 3² × 5. Every integer greater than 1 has exactly one such factorization, up to the order of the factors.

How does trial division work?

The calculator divides by 2, then by 3, 5, 7 and each larger odd number, removing each prime as often as it divides. It only tests up to the square root of what remains, because any larger factor would pair with a smaller one already found.

How do I know if a number is prime?

If no integer from 2 up to the square root of the number divides it, the number is prime. The calculator states this explicitly and shows the square-root bound it checked.

What do the exponents mean?

An exponent counts how many times a prime appears. 2³ means 2 is a factor three times (2 × 2 × 2). Writing repeated factors as powers keeps the factorization compact.

Why is there an upper limit on the input?

Trial division stays exact only while the number fits in double-precision integers. Above 10^15 the calculator returns an error rather than risk an inexact factorization.

Methodology & verification

The number is factored by trial division: divide out 2, then ascending odd numbers, testing divisors only up to the square root of the current remainder. Any remainder above 1 at the end is itself prime. Inputs are validated as integers ≥ 2 and below 10^15 (so division stays exact); other inputs return structured errors. Repeated factors are grouped into exponent form, and the factors are multiplied to confirm they equal the original number.

Engine: math-solvers v1.4.0 · Last reviewed: · Every result is computed client-side and never sent to a server. See the verification methodology and the scientific calculator validation.