Logo

MonoCalc

/

Prime Factorization Calculator

Math

Enter a positive integer and click Calculate to see its prime factorization.

About This Tool

🔢 Prime Factorization Calculator – Break Any Integer Into Its Primes

The Prime Factorization Calculator decomposes any positive integer into its unique set of prime building blocks. Enter a number, choose an optional input base, and instantly receive the canonical prime power notation (e.g., 360 = 2³ × 3² × 5), a full step-by-step division log, and advanced divisor statistics — all in one place.

What Is Prime Factorization?

Every integer greater than 1 can be written as a product of prime numbers in exactly one way — a principle called the Fundamental Theorem of Arithmetic. For example:

360 = 2 × 2 × 2 × 3 × 3 × 5
    = 2³ × 3² × 5

 84 = 2² × 3 × 7
 97 = 97¹  (prime)

The factorization is always written with primes in ascending order. If the input number is already prime, the result is simply p¹.

How the Calculation Works

The tool uses trial division with BigInt arithmetic:

  1. Divide repeatedly by 2 while the number is even.
  2. Test odd divisors 3, 5, 7 … up to √n.
  3. Each time a divisor divides evenly, record it and continue with the quotient.
  4. If the remaining value is greater than 1, it is the final prime factor.

Using BigInt means the calculator handles numbers far beyond JavaScript's safe integer limit without precision loss.

Key Outputs Explained

OutputExample (n = 360)Formula
Prime Power Notation2³ × 3² × 5Canonical form
Expanded List2, 2, 2, 3, 3, 5All factors with repetition
Divisor Count24∏ (eᵢ + 1)
Divisor Sum1170∏ (pᵢ^(eᵢ+1) − 1) / (pᵢ − 1)
Largest Prime Factor5Max prime in the factorization

Divisor Count and Divisor Sum Formulas

If n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ, then:

  • Divisor count d(n) = (a₁ + 1)(a₂ + 1)…(aₖ + 1) — counts every positive divisor of n.
  • Divisor sum σ(n) = ∏ [(pᵢ^(aᵢ+1) − 1) / (pᵢ − 1)] — sums every positive divisor of n.

These values are useful in number theory, perfect number analysis, and cryptographic primality testing.

Input Base Support

The calculator accepts numbers in decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). This is useful when working with binary data, memory addresses, or color codes that you want to factor in decimal.

Batch Factorization Mode

Switch to Batch Mode to factor several integers at once. Enter numbers separated by commas or new lines (e.g., 84, 90, 97, 360). The tool produces a result table with the factorization and divisor data for each entry.

Special Cases

  • n = 1 — The number 1 has no prime factors. It is neither prime nor composite. Its divisor count is 1 and its divisor sum is 1.
  • Prime inputs — Reported as prime with factorization p¹. Divisor count = 2, divisor sum = 1 + p.
  • Powers of a single prime — e.g., 128 = 2⁷. Only one prime factor appears.

Practical Applications

Prime factorization is the foundation of many mathematical and computational tasks:

  • GCD and LCM — The greatest common divisor and least common multiple of two numbers can be read directly from their shared prime factors.
  • Fraction simplification — Factor the numerator and denominator, then cancel common primes.
  • Cryptography — RSA encryption relies on the computational difficulty of factoring large semi-prime numbers.
  • Perfect and abundant numbers — Use divisor sum σ(n) to classify integers.

All calculations use BigInt arithmetic and run entirely in your browser. No data is sent to a server.

Frequently Asked Questions

Is the Prime Factorization Calculator free?

Yes, Prime Factorization Calculator is totally free :)

Can I use the Prime Factorization Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Prime Factorization Calculator?

Yes, any data related to Prime Factorization Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is prime factorization?

Prime factorization is the process of expressing a positive integer as a product of its prime factors. For example, 360 = 2³ × 3² × 5. Every integer greater than 1 has a unique prime factorization, which is guaranteed by the Fundamental Theorem of Arithmetic.

How does this Prime Factorization Calculator work?

Enter a positive integer and click Calculate. The tool uses trial division — repeatedly dividing by 2 and then by odd numbers up to the square root of the remaining value — to extract all prime factors. Results include the canonical prime power notation, an expanded list, step-by-step division log, and divisor statistics.

What are the divisor count and divisor sum?

If n = p₁^a₁ × p₂^a₂ × … then the divisor count is (a₁+1)(a₂+1)… and the divisor sum is the product of (pᵢ^(aᵢ+1) − 1)/(pᵢ − 1) over all prime factors. For 360 = 2³ × 3² × 5, the divisor count is 4 × 3 × 2 = 24 and the divisor sum is 1170.

What happens when I enter a prime number?

When the input is prime (e.g., 97 or 101), the calculator reports it as prime, shows the trivial factorization p¹, and confirms that no further factorization is possible. The divisor count will be 2 and the divisor sum will be 1 + p.

Can I use different number bases as input?

Yes. The Input Base selector lets you type the number in decimal (base 10), binary (base 2), octal (base 8), or hexadecimal (base 16). The factorization is always performed and displayed in base 10.

What is the maximum number this tool can handle?

The calculator uses JavaScript's BigInt, so it can handle arbitrarily large integers. However, trial division slows down for numbers with large prime factors above roughly 10^12. For extremely large composites, computation may take several seconds.