Sumivo · Mathematics

Prime Factorization Calculator

Break a whole number into the product of its prime factors, with exponents — the unique prime factorization guaranteed by the fundamental theorem of arithmetic.

01 / inputs

integer

02 / result

PRIME FACTORIZATION

2^3 × 3^2 × 5

Factorization
2^3 × 3^2 × 5
Distinct primes
3
Prime?
No

Calculation trace

  1. 2^3 = 8
    8
    Factor out 2
  2. 3^2 = 9
    9
    Factor out 3
  3. 5
    5
    Remaining prime

Maintained by Jack Shi

§

How it works

Prime factorization writes a whole number as a product of prime numbers. The tool uses trial division: it divides by 2 as many times as possible, then by each odd number 3, 5, 7, … up to the square root of what remains, recording how many times each prime divides in. Any value left above 1 at the end is itself a prime factor. By the fundamental theorem of arithmetic, every integer greater than 1 has exactly one such factorization (apart from the order of the factors) — for example 360 = 2^3 × 3^2 × 5.

Assumptions & limits

  • Defined for integers greater than 1; 1, zero, negatives, and decimals are rejected.
  • Exponents show repeated primes, so 8 is written 2^3 rather than 2 × 2 × 2.
  • Inputs are capped at 1,000,000,000,000 so the factorization stays fast in the browser.

Verified runs

Synthetic examples executed at build revision 24533ff on . Cards round decimal results to 6 significant figures; matching uses full precision and the tolerance below. Matches cover the displayed fields, not every possible input or clinical or engineering validation.

  • Inputs: Integer: 360 integer

    Result: Prime factorization: 2^3 × 3^2 × 5 prime powers (expected Prime factorization: 2^3 × 3^2 × 5 prime powers) ✓

  • Inputs: Integer: 2 integer

    Result: Prime factorization: 2 prime powers (expected Prime factorization: 2 prime powers) ✓

  • Inputs: Integer: 100 integer

    Result: Prime factorization: 2^2 × 5^2 prime powers (expected Prime factorization: 2^2 × 5^2 prime powers) ✓

How these runs were checked

Method: prime-factorization@1.0.0. Expectations come from the listed test fixtures or hand arithmetic; they are not copied from these executions. Omitted optional inputs use the method defaults. Run dates record execution, not expert review or fresh measurements.

Download all verified runs (JSON) — full inputs, returned values, expectations, timestamps and buildRevision.

  • normal: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Prime factorization: 2^3 × 3^2 × 5 prime powers. Expected: Prime factorization: 2^3 × 3^2 × 5 prime powers. Expectation: packages/calculator-core/tests/prime-factorization.test.ts
  • boundary: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Prime factorization: 2 prime powers. Expected: Prime factorization: 2 prime powers. Expectation: packages/calculator-core/tests/prime-factorization.test.ts
  • sensitivity: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Prime factorization: 2^2 × 5^2 prime powers. Expected: Prime factorization: 2^2 × 5^2 prime powers. Expectation: packages/calculator-core/tests/prime-factorization.test.ts

Reproduce from the source checkout with pnpm --filter @sumivo/web gen:verified-runs. A rebuild changes execution times; the revision identifies its Git starting point, including any uncommitted changes made for that build.

§

FAQ

What is prime factorization?
It is writing a number as a product of prime numbers. For 12 the prime factorization is 2^2 × 3, meaning 2 × 2 × 3.
Is the prime factorization of a number unique?
Yes. The fundamental theorem of arithmetic says every integer greater than 1 has exactly one prime factorization, apart from the order in which you write the factors.
What does it mean when a number has one prime factor?
If the only prime factor is the number itself (with exponent 1), the number is prime — for example 17 = 17.
Why can’t 1 be prime-factorized?
1 has no prime factors, and 1 is not itself prime, so it has no prime factorization. Prime factorization is defined for integers of 2 or more.
How is prime factorization used?
It is the basis for finding the greatest common factor and least common multiple, simplifying fractions, and much of number theory and cryptography.
§

Related calculators

§

SOURCES

  • OpenStax, Rice University
    Prealgebra 2e ↗

    Prime factorization and the fundamental theorem of arithmetic

    Accessed 2026-09-02