2026-08-07 9 min

Prime Factorization Calculator

Find prime factors with a factor-tree diagram and step-by-step trial division. Check primality for any integer up to 10,000,000.

Calculator

Number Help

Positive integer from 2 to 10,000,000

Results update live as you type
Status:820 is composite2^2 × 5 × 41

Prime Factorization of 820

Factorization2^2 × 5 × 41
VerdictComposite
820 ÷ 2 = 410 (divisible)
410 ÷ 2 = 205 (divisible)
205 ÷ 2 = remainder 1
205 ÷ 3 = remainder 1
205 ÷ 4 = remainder 1
205 ÷ 5 = 41 (divisible)
41 ÷ 5 = remainder 1
41 ÷ 6 = remainder 5
41 ÷ 41 = 1 (divisible)

Results

Normal

Prime Factorization

2^2 × 5 × 41

Factorization of 820

Primality

Composite

More than two divisors

Distinct Prime Factors

3

Unique primes in the product

Factors with Multiplicity

4

Counting repeated primes

Largest Prime Factor

41

Maximum leaf of the tree

Smallest Prime Factor

2

First divisor found by trial division

Trial-Division Rows

9

Divisibility tests performed

Trial division is exact for integers 2–10,000,000. Large primes near the cap test the most divisors and take longest.

Visualizations

Prime Factors

22
15
141

Exponent Share

250%
525%
4125%

Largest Factor Share

Largest / n5%

Distinct vs Total Factors

Distinct3

Formula

Trial division finds the smallest divisor, divides it out completely, and repeats. Leftover above 1 is prime. Exponents compress repeats; the tree records the same splits visually.

n = p₁^e₁ × p₂^e₂ × … (unique)

Alternative Form

Trial division: test d = 2,3,… while d² ≤ n; divide out fully each time

Variables

SymbolNameUnitDescription
nInput numberinteger2 to 10,000,000
pᵢPrime factorintegerPrime divisor of n
eᵢExponentcountMultiplicity of pᵢ
dTrial divisorintegerRuns while d² ≤ current n

Explanation

Every composite has a unique prime product. Trial division is the direct route: peel off small primes first, and whatever survives past √n must itself be prime.

Derivation

For d from 2 while d² ≤ m: while m mod d = 0, record d and set m ← m/d. If m > 1, record m. Group equal primes into exponents.

Step-by-Step Calculation

Follow each step to understand how the result is calculated from your inputs.

Step 1

Start trial division at 2 on the input number.

Test n mod 2
n:820
Intermediate: 820 ÷ 2 = 410; 410 ÷ 2 = 205; 205 ÷ 5 = 41
Result: Smallest prime factor = 2
Step 2

Divide out each found prime completely before advancing.

n ← n / p while divisible
Distinct primes:3
Intermediate: 9 divisibility rows
Result: Quotient chain ends at prime 41
Step 3

Stop when divisor² exceeds the remaining quotient.

Stop when d² > n
n:820
Intermediate: Remainder above 1 is prime
Result: Largest prime factor = 41
Step 4

Collect repeated primes as exponents.

p^e notation
Factorization:2^2 × 5 × 41
Intermediate: 4 primes with multiplicity
Result: 2^2 × 5 × 41
Step 5

Branch the factor tree until every leaf is prime.

n → a × b recursively
Leaves:2^2 × 5 × 41
Intermediate: Composite nodes split; primes stop
Result: Tree verifies 2^2 × 5 × 41 = 820
Step 6

Classify primality from the factor count.

Prime ⟺ one factor, exponent 1
Verdict:Composite
Intermediate: 3 distinct primes
Result: 820 is composite
Final Answer
2^2 × 5 × 41

Worked Examples

See how the calculator works with different scenarios.

Scenario

Default classroom example.

Inputs

n:820

Calculation

820÷2=410; 410÷2=205; 205÷5=41; 41 prime

Result

2² × 5 × 41 = 820

Interpretation

Two halvings, one fifth, and a prime remainder — the tree leaves read 2, 2, 5, 41.

Understanding Your Result

Your Result: Prime Factorization: 2^2 × 5 × 41

Typical range: Inputs 2–10,000,000; trial rows grow toward √n for primes.

What This Means

The factorization string is the unique prime product; the tree shows how splits produced it and the verdict labels the input prime or composite.

Why It Matters

GCF, LCM, fraction reduction, and RSA all rest on prime structure. Seeing the tree builds the number sense behind those tools.

Professional Interpretation

Trial division is exact and pedagogical here; cryptographic scales need Pollard Rho / sieve methods instead.

Recommendations

  • •Read leaves for the factor list
  • •Use exponents to spot squares and cubes
  • •Compare distinct vs total for repetition
  • •Reuse primes for GCF/LCM work
  • •Try neighbors to find twin primes

Educational Content

Introduction

Primes are integers with exactly two divisors. Factoring composites into primes reveals the multiplicative DNA shared by fractions, divisors, and ciphers.

Concept Explanation

Divide by 2, then 3, then 5…, always dividing out fully; group repeats as exponents; branch composites in a tree until leaves are prime.

Applications

▸GCF and LCM computation
▸Fraction simplification
▸Divisor enumeration
▸RSA intuition and semiprimes
▸Mental-math divisibility practice
▸Contest number theory

Benefits

  • •Unique representation per number
  • •Visual tree for learners
  • •Full step trace for checking
  • •Instant primality verdict
  • •Reference table 2–150 concept

Limitations

  • •Caps at 10,000,000
  • •Trial division slows on large primes
  • •Integers only (no negatives/fractions)
  • •Single-threaded stepping

Best Practices

  • •Test 2, 3, 5 first mentally
  • •Divide out fully before advancing
  • •Stop at √remainder
  • •Write exponents compactly
  • •Verify product equals input

Common Misconceptions

Myth: 1 is prime.
Truth: 1 has one divisor and is neither prime nor composite; it is the empty product.
Myth: Factor order matters.
Truth: Uniqueness is up to order — 2×3 and 3×2 are the same factorization.
Myth: Large primes factor quickly by trial.
Truth: Trial division to √n is exponential work; big primes need advanced tests.
Myth: Even numbers share no odd primes.
Truth: Even composites like 2×3×5 have plenty of odd prime factors.

Practical Tips

  • •Start mental checks with 2, 3, 5
  • •Divide out each prime fully
  • •Stop testing past the square root
  • •Use exponents for repeated primes
  • •Multiply leaves to verify the input
  • •Compare distinct vs total counts
  • •Re-run neighbors to explore patterns

Common Mistakes

Stopping after the first divisor
Keep dividing the quotient by the same prime until it no longer divides.
Testing past √n unnecessarily
Once d² exceeds the remainder, the remainder itself is prime.
Writing repeats longhand
Group equal primes: 2×2×2 becomes 2³.
Calling 1 prime
1 is neither prime nor composite; factorizations start at 2.
Mixing factors with prime factors
Only prime leaves belong in the factorization string.

Assumptions

This calculator makes the following assumptions to provide estimates:

Positive Integers: Inputs are integers from 2 to 10,000,000.
Trial Division: Divisors tested ascending from 2.
Full Division: Each prime divided out completely.
Exact Arithmetic: Integer division with no rounding.
Local Compute: Factoring runs in the browser.

Limitations

Be aware of these limitations when using this calculator:

10M Cap: Larger inputs are rejected for responsiveness.
Slow Large Primes: Prime inputs near the cap test up to √n.
No Crypto Scale: Hundreds-digit semiprimes are out of scope.
Integers Only: Negatives, zero, and fractions excluded.

Frequently Asked Questions

Answers to common questions about this calculator.

What is prime factorization?
Prime factorization expresses a composite number as a product of prime factors, e.g. 12 = 2² × 3. Every integer above 1 has a unique factorization (Fundamental Theorem of Arithmetic), used for GCF, LCM, fraction simplification and cryptography.
What is a prime number?
A prime is an integer above 1 with exactly two divisors: 1 and itself (2, 3, 5, 7, 11, 13, …). 1 is neither prime nor composite; all larger integers factor uniquely into primes.
How does prime factorization work?
Trial division tests primes from 2 upward: record each divisor, divide it out, and repeat on the quotient until the square of the divisor exceeds the remainder, which is then prime. Exponents compress repeats (2³ × 3² for 72).
What is a factor tree?
A factor tree branches a number into factor pairs until every leaf is prime. The product of the leaves is the factorization — a visual version of trial division.
What is the difference between a factor and a prime factor?
Factors are all even divisors (12 → 1,2,3,4,6,12); prime factors are the prime subset (2,3). Factorization uses only the prime subset.
What is the Fundamental Theorem of Arithmetic?
Every integer above 1 factors uniquely into primes up to order. Factoring 60 as 6×10 or 4×15 always yields 2² × 3 × 5.
How is prime factorization used for GCF and LCM?
GCF takes shared primes at minimum exponents; LCM takes all primes at maximum exponents. For 72=2³×3² and 60=2²×3×5: GCF=2²×3=12, LCM=2³×3²×5=360.
What is the prime factorization of 0 or 1?
Neither has one: 0 has infinitely many divisors and 1 is the empty product (multiplicative identity). The theorem covers integers above 1.
How do you check if a number is prime?
Test divisibility by primes up to √n (optimized via 2, 3, then 6k±1 candidates). This calculator does that automatically and labels the result.
Can prime factorization be used for cryptography?
Yes — RSA rests on multiplying large primes being easy while factoring the product is infeasible at hundreds of digits. This tool handles learning-scale numbers up to 10,000,000.
What is a semiprime number?
A product of exactly two primes (e.g. 6=2×3, 25=5×5). RSA moduli are semiprimes of two large primes.
How do you write prime factorization with exponents?
List primes ascending, using exponents for repeats: 2×2×2×3×3 becomes 2³ × 3². Exponent 1 is omitted.

Related Calculators

Explore more calculators related to this topic.

Related Guides

Deepen your understanding with these educational resources.

Glossary

Technical terms used in mortgage calculations explained in plain language.

Prime number
Integer above 1 with exactly two divisors.
Composite number
Integer above 1 that is not prime.
Prime factorization
Unique product of primes equal to n.
Exponent
Count of a repeated prime factor.
Factor tree
Branching diagram splitting composites to primes.
Trial division
Testing divisors ascending from 2.
Multiplicity
Total prime occurrences counting repeats.
Semiprime
Product of exactly two primes.
Mersenne prime
Prime of form 2^n − 1.
Twin primes
Prime pair differing by 2.

Authoritative References

Trusted sources and standards referenced by this calculator.

Applicable Standards

Common Core 6.NS.B.4 (GCF/LCM via primes)NCTM Number & Operations expectations

Was This Calculator Helpful?

Page Information

Last Updated:

2026-08-07

Version:

2.0.0

License:

Free to use for educational and professional purposes.