Skip to main content
Math

Prime Factorization Calculator

Enter any integer from 2 up to 1,000,000,000,000 and the calculator instantly returns its prime factorisation (e.g. 360 = 2³ × 3² × 5), tells you whether it is prime or composite, and lists τ(n) the number of divisors, σ(n) the sum of divisors and every positive divisor — handy for simplifying fractions, GCD/LCM, number-theory homework and RSA practice.

Prime factorisation

2³ × 3² × 5

2 × 2 × 2 × 3 × 3 × 5

Number of divisors τ(n)

24

τ(n) = Π (eᵢ + 1), counts 1 and n.

Sum of divisors σ(n)

1,170

σ(n) = Π (pᵢ^(eᵢ+1) − 1) ÷ (pᵢ − 1).

Per-factor breakdown

Prime Exponent Contribution
2 3 8
3 2 9
5 1 5

All positive divisors

Uses 6k±1 trial division — factorises any integer up to 10¹² instantly.

Formula

n = p₁^e₁ × p₂^e₂ × … × p_k^e_k | τ(n) = Π(eᵢ + 1) | σ(n) = Π (pᵢ^(eᵢ+1) − 1) ÷ (pᵢ − 1)

Frequently asked

Why is the upper limit 10¹² (one trillion)?

JavaScript Number can hold integers up to 2⁵³ − 1 ≈ 9 × 10¹⁵ precisely, but trial division has to walk up to √n. If n is much larger, the worst case (n a product of two primes near √n) requires testing 10⁸+ odd candidates, which stalls in a phone browser. Capping at 10¹² keeps √n around 10⁶, giving instant answers in every case. For very large numbers use Wolfram Alpha, SageMath, or algorithms like Pollard rho / ECM.

How can I use prime factorisation to find GCD and LCM?

Factor each number: a = Π pᵢ^aᵢ, b = Π pᵢ^bᵢ. Then GCD = Π pᵢ^min(aᵢ, bᵢ) and LCM = Π pᵢ^max(aᵢ, bᵢ). The identity GCD(a, b) × LCM(a, b) = a × b always holds. Example: 60 = 2² × 3 × 5, 126 = 2 × 3² × 7, so GCD = 2 × 3 = 6 and LCM = 2² × 3² × 5 × 7 = 1260.

Can I use this to simplify fractions?

Yes. Factor numerator and denominator, then cancel any shared prime factors (the GCD). Example: 84/180 with 84 = 2² × 3 × 7 and 180 = 2² × 3² × 5 share 2² × 3 = 12, so 84/180 simplifies to 7/15.

How does this relate to RSA encryption?

RSA security rests on the fact that multiplying two huge primes is easy, but recovering them from the product is computationally infeasible. Real-world RSA moduli are 2048–4096 bits (far beyond 10¹²), so no browser-based trial division can break them. This tool is for teaching and small examples only, not for cracking RSA keys.

Related tools

Percentage Calculator

Percent of, percent change, and percent add/subtract in one.

GCD & LCM Calculator

Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.

Average Calculator (Mean / Median / Mode)

Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.

Quadratic Equation Solver

Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.

Password Strength (Entropy) Calculator

Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.

Scientific Notation Converter

Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.

Permutations & Combinations (nPr / nCr) Calculator

Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.

Standard Deviation Calculator

Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.

Triangle Calculator (SSS / SAS / ASA)

Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.

Pythagorean Theorem Calculator

Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.

Circle Calculator (radius / diameter / circumference / area)

Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.

Roman Numeral Converter

Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.

Slope & Line Equation Calculator (y = mx + b from Two Points)

Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.

Birthday Paradox Calculator

Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.

Logarithm Calculator (log / ln / log₂ / any base)

Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.

Z-Score (Standard Score) Calculator

Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.

Screen Pixel Density (PPI) Calculator

Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.

Hong Kong Mark Six Odds Calculator

Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.

Decimal to Fraction Converter

Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.

Sphere Volume & Surface Area Calculator

Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.

Cylinder Volume & Surface Area Calculator

Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.

Geometric Mean Calculator

Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.

Fibonacci Sequence Calculator

Enter any integer n from 0 to 1500 to instantly compute F(n) and F(n−1) with BigInt precision, the consecutive-term ratio (converging to the golden ratio φ) and the first 30 terms of the sequence.