Factor Calculator Explained: Divisors, Prime Factorisation and σ(n)
A factor of n is any positive integer that divides n with no remainder. This guide covers the trial-division algorithm the factor calculator uses, the fundamental theorem of arithmetic, the divisor-count formula d(n) = ∏(aᵢ + 1), the multiplicative shortcut for σ(n), a worked breakdown of 360, and the connection to GCD, LCM, perfect numbers, and cryptography.
What a factor actually is
A factor of a whole number n is any positive integer that divides n with no remainder. Eight has four of them: 1, 2, 4 and 8. Twelve has six: 1, 2, 3, 4, 6 and 12. The word "divisor" means exactly the same thing — both names show up in textbooks and exam papers, and the factor calculator at the top of this page treats them as synonyms. What a factor is not is a multiple. The multiples of 12 are the numbers 12 reaches by multiplication — 12, 24, 36, 48, 60 — while the factors of 12 are the numbers that reach 12 by division. Factors look down from n; multiples look up.
That one definition carries surprisingly far. Every classical question in elementary number theory — primality, greatest common divisor, lowest common multiple, perfect numbers, Euler's totient, modular inverses — is some question about factors. Once you can list the factors of a number, you can answer most of those questions by inspection. The factor calculator produces five outputs at once: every divisor in ascending order, the prime factorisation, all factor pairs, σ(n) (the sum of those divisors), and a label saying whether the number is prime, composite, or perfect. The rest of this article walks through where each of those comes from and what to do with them.
How the calculator finds factors: trial division
The straightforward way to find every factor of n is to test each integer from 1 up to n and keep the ones that divide cleanly. That works but it is wasteful. Every factor pairs with another: if 4 divides 60, then 60 ÷ 4 = 15 is also a factor, and you find both at once. So you only need to test as far as the square root of n. Above √n every new divisor is just the larger half of a pair already found. For 60, √60 ≈ 7.75, so trial division stops at 7 and the full list of twelve factors falls out in eight checks rather than sixty.
for i = 1 to floor(sqrt(n)):
if n mod i == 0:
add i and n/i to the factor list
sort and dedupe (handles perfect squares)This is the textbook algorithm — Hardy and Wright cover it in §1.2 of An Introduction to the Theory of Numbers, and it is the same procedure Eratosthenes used to sieve primes around 240 BC. It runs in O(√n) time, which is fast enough for any integer that fits inside JavaScript's safe range (up to 2⁵³ − 1 ≈ 9.0 × 10¹⁵). Numbers above that point need arbitrary-precision arithmetic and faster factoring methods — Pollard's rho, the quadratic sieve, or the general number field sieve — and the gap between trial division and those methods is the foundation of every public-key cryptosystem in use today. RSA is hard precisely because factoring a 2048-bit composite by trial division would take longer than the age of the universe.
Prime factorisation and the fundamental theorem of arithmetic
Every integer greater than 1 is either prime or a product of primes in essentially one way. That statement — the fundamental theorem of arithmetic — is the result Euclid proves in Book VII, Propositions 30 and 32 of the Elements, written around 300 BC. It is the reason factoring is well-defined: 60 is 2 × 2 × 3 × 5 and there is no other multiset of primes whose product is 60. The factor calculator presents the result in canonical form, smallest prime first with repeated primes collected as p^k, so 60 appears as 2² × 3 × 5.
The algorithm is even simpler than trial-division for divisors. Start with the smallest prime, 2. Divide n by 2 as many times as 2 still divides it, counting each pass. Move on to 3, then 5, then 7, and so on through the primes, stopping when the remaining quotient is either 1 or itself a prime larger than √n. The exponents in the canonical form are exactly those counts. For 360:
360 ÷ 2 = 180 (×2 once) 180 ÷ 2 = 90 (×2 twice) 90 ÷ 2 = 45 (×2 three times) 45 ÷ 3 = 15 (×3 once) 15 ÷ 3 = 5 (×3 twice) 5 ÷ 5 = 1 (×5 once) 360 = 2³ × 3² × 5
Why does this matter? Because once you have the prime factorisation, almost every divisor question becomes a counting exercise. The number of positive divisors is the product of (each exponent + 1) — for 360 that is (3+1)(2+1)(1+1) = 24. You can pick any exponent from 0 up to the maximum independently, and each combination gives a different divisor. The greatest common divisor of two numbers is the product of the lowest matching prime exponents from each; the lowest common multiple is the product of the highest. Use the dedicated GCF calculator and LCM calculator for those, but the underlying arithmetic is the same.
Worked example: factoring 360
Type 360 into the factor calculator and the breakdown returns five things. The headline is the divisor count, 24. The full list is 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360 — symmetric around √360 ≈ 18.97, with twelve factors below and twelve above. The prime factorisation, as worked out above, is 2³ × 3² × 5. The factor pairs are
1 × 360 2 × 180 3 × 120 4 × 90 5 × 72 6 × 60 8 × 45 9 × 40 10 × 36 12 × 30 15 × 24 18 × 20
The sum of divisors σ(360) is 1170. You can verify that by adding the list above, or compute it the fast way from the factorisation:
σ(360) = σ(2³) × σ(3²) × σ(5)
= (2⁴ − 1)/(2 − 1) × (3³ − 1)/(3 − 1) × (5² − 1)/(5 − 1)
= 15 × 13 × 6
= 1170That formula — σ(p^k) = (p^(k+1) − 1) / (p − 1), and σ multiplicative across distinct primes — is what makes σ tractable for numbers far too large to list divisors of. It is how the calculator returns σ in microseconds even for an eight-digit input. 360 is also abundant: σ(n) − n = 810, which is more than 360 itself. That makes 360 a number whose proper divisors overshoot it, which is one reason it crops up so often in old measurement systems (degrees in a circle, minutes in six hours, seconds in six minutes) — it can be divided evenly in lots of useful ways.
Perfect, abundant, and deficient numbers
Take the sum of every divisor of n except n itself — the so-called aliquot sum, σ(n) − n. Three things can happen. If the aliquot sum equals n, the number is perfect: 6 (= 1 + 2 + 3), 28 (= 1 + 2 + 4 + 7 + 14), 496, 8128. If it is greater, the number is abundant: 12, 18, 20, 24, 30, 360. If it is smaller, the number is deficient: every prime, every power of 2, and most numbers you bump into in daily life. The factor calculator flags perfect numbers directly; for the abundant / deficient split, compare σ(n) − n against n in the breakdown.
Perfect numbers are genuinely rare. Euclid proved that if 2^p − 1 is a Mersenne prime (a prime of that special form), then 2^(p−1)(2^p − 1) is perfect. Euler proved the converse for even perfect numbers: every one of them has that Euclid-Euler shape. The list is therefore in one-to-one correspondence with the Mersenne primes, of which 52 are currently known — the largest, M82589933, has more than 24 million digits, and the corresponding perfect number has nearly 50 million. Whether any odd perfect number exists is one of the oldest open problems in mathematics; if there is one, it must exceed 10^1500 and has to satisfy a long list of structural constraints, but nothing rules it out.
What factors are good for
Simplifying fractions
To reduce 360 / 462 to lowest terms, divide top and bottom by their greatest common divisor. From the prime factorisations 360 = 2³ × 3² × 5 and 462 = 2 × 3 × 7 × 11, the shared primes are 2 (lower exponent 1) and 3 (lower exponent 1), so GCD = 6 and the reduced fraction is 60 / 77. The fraction calculator automates the whole chain, but the factor breakdown is the underlying arithmetic.
Finding common multiples
For LCM, take each prime appearing in either number and raise it to the higher of the two exponents. LCM(360, 462) = 2³ × 3² × 5 × 7 × 11 = 27,720. That is the answer to "when do two events with periods 360 and 462 days next coincide". The LCM calculator handles this directly.
Powers and roots
A number is a perfect square exactly when every exponent in its prime factorisation is even, a perfect cube exactly when every exponent is a multiple of three, and so on. 360 has exponent 3 on the prime 2, so it cannot be a perfect square; √360 is irrational. 14,400 = 2⁶ × 3² × 5² has all even exponents, so √14,400 = 2³ × 3 × 5 = 120 exactly. The exponent calculator handles arbitrary powers and roots once the factorisation is in hand.
Cryptography and primality testing
The hard direction — given a large composite, find its prime factors — is the wall that RSA and several other public-key systems hide behind. Multiplying two 2048-bit primes together is trivial; reversing the operation is, with current algorithms, completely infeasible. Smaller cases use the easy direction. The primality label on the calculator is decided by counting divisors: exactly two means prime.
Common mistakes
Forgetting 1 and n
Both 1 and n itself are factors of n. A test that says "the factors of 12 are 2, 3, 4, 6" is wrong by two — it has missed 1 and 12. The factor calculator includes them by default, and the convention matches every textbook from Euclid forward. Proper divisors exclude n; non-trivial divisors exclude both 1 and n. Watch which one the question is asking for.
Treating 1 as prime
One has exactly one divisor (itself), so by the modern convention it is neither prime nor composite. Including 1 in the primes would break the uniqueness half of the fundamental theorem — 12 could be written as 1 × 2² × 3 or 1 × 1 × 2² × 3, all different. Nineteenth-century textbooks did sometimes list 1 as prime, and the older convention still surfaces, but it is now universally dropped.
Confusing "factor" with "factor pair"
Twelve has six factors (1, 2, 3, 4, 6, 12) but three factor pairs (1×12, 2×6, 3×4). The pair count is the divisor count divided by two, rounded up — the rounding handles perfect squares, where the middle pair is i × i. The factor pairs view is useful when you are looking for the rectangular dimensions of a given area, or trying every short × long split of a given product.
Negative numbers and zero
Factors are conventionally non-negative. The calculator accepts negative inputs and reports the factors of the absolute value. Zero is a separate case: every non-zero integer divides 0, so 0 has infinitely many factors and no prime factorisation. The calculator labels that case directly rather than try to list an infinite set.
When the answer needs more than a list
For very large numbers (above 10¹⁵ or so), the trial-division approach the factor calculator uses becomes too slow and the safe-integer range runs out. Production cryptography and computational number theory use specialised libraries — GMP, PARI/GP, SageMath — with Pollard's rho, the elliptic-curve method, and the general number field sieve. For schoolwork, exam practice, recreational number theory, and any engineering calculation involving common divisors of moderate-sized integers, trial division is more than enough and the algorithmic detail rarely matters.
Frequently asked questions
Is 1 a factor of every number?
Yes. One divides every integer exactly, so 1 is in the factor list of every n. The same applies to n itself: n divides n. These two endpoints are why every whole number greater than 1 has at least two divisors, and a prime is defined as a number with exactly those two and no others.
How many factors does 1,000,000 have?
One million is 10⁶ = 2⁶ × 5⁶, so by the divisor-count formula it has (6 + 1)(6 + 1) = 49 factors. The list runs from 1 up to 1,000,000 with everything that can be written as 2^a × 5^b for 0 ≤ a, b ≤ 6 in between. The factor calculator shows the full list and every factor pair in one click.
Why is the divisor count odd for square numbers?
Every divisor of n pairs with n / d to give n. When n is a perfect square, the square root pairs with itself, so one of the pairs has the same number twice and the total count is odd. Every other number has divisors in distinct pairs, so an even count. 36 = 6² has nine divisors: 1, 2, 3, 4, 6, 9, 12, 18, 36 — the 6 is its own partner.
What is the largest number the calculator can factor?
Anything up to JavaScript's safe-integer limit, 2⁵³ − 1 = 9,007,199,254, 740,991, factors in well under a second. Numbers above that point lose precision in floating-point arithmetic and the calculator stops accepting them. For larger inputs you need arbitrary-precision arithmetic — a CAS or a dedicated library — which is outside the scope of a trial-division tool.
Are factors of negative numbers also negative?
By the standard convention used here and in most school and undergraduate texts, factors are positive integers regardless of the sign of n. The factor calculator takes the absolute value of the input and lists the positive factors of that. Some advanced texts define factors over the integers and include negative divisors (so 12 would have ±1, ±2, ±3, ±4, ±6, ±12), but the count and structure are otherwise identical.
How is this different from a GCF or LCM calculator?
A factor calculator works on a single number and lists everything that divides it. The GCF calculator takes two or more numbers and finds the largest common divisor; the LCM calculator finds the smallest common multiple. All three rely on the same prime-factorisation arithmetic — the factor calculator just exposes the underlying breakdown without combining anything.
What is the difference between σ(n) and φ(n)?
σ(n) is the sum of all positive divisors of n, including 1 and n itself — what the calculator returns as "sum of divisors". φ(n) is Euler's totient: the count of integers from 1 to n that share no factors with n. Both are multiplicative functions of n built from the prime factorisation, but they answer different questions. σ is about divisor structure; φ is about coprimality and shows up in the Fermat-Euler theorem and RSA key generation.
Frequently asked questions
Is 1 a factor of every number?
Yes. One divides every integer exactly, so 1 is in the factor list of every n. The same applies to n itself: n divides n. These two endpoints are why every whole number greater than 1 has at least two divisors, and a prime is defined as a number with exactly those two and no others.
How many factors does 1,000,000 have?
One million is 10⁶ = 2⁶ × 5⁶, so by the divisor-count formula it has (6 + 1)(6 + 1) = 49 factors. The list runs from 1 up to 1,000,000 with everything that can be written as 2^a × 5^b for 0 ≤ a, b ≤ 6 in between.
Why is the divisor count odd for square numbers?
Every divisor of n pairs with n / d to give n. When n is a perfect square, the square root pairs with itself, so one pair has the same number twice and the total count is odd. Every other number has divisors in distinct pairs, so an even count. 36 = 6² has nine divisors: 1, 2, 3, 4, 6, 9, 12, 18, 36.
What is the largest number the calculator can factor?
Anything up to JavaScript's safe-integer limit, 2⁵³ − 1 = 9,007,199,254,740,991, factors in well under a second. Numbers above that point lose precision in floating-point arithmetic and the calculator stops accepting them. For larger inputs you need arbitrary-precision arithmetic such as a computer-algebra system.
Are factors of negative numbers also negative?
By the standard convention used in school and undergraduate texts, factors are positive integers regardless of the sign of n. The factor calculator takes the absolute value of the input and lists the positive factors of that. Some advanced texts define factors over the integers and include negative divisors, but the count and structure are otherwise identical.
How is this different from a GCF or LCM calculator?
A factor calculator works on a single number and lists everything that divides it. A GCF calculator takes two or more numbers and finds the largest common divisor; an LCM calculator finds the smallest common multiple. All three rely on the same prime-factorisation arithmetic — the factor calculator just exposes the underlying breakdown without combining anything.
What is the difference between σ(n) and φ(n)?
σ(n) is the sum of all positive divisors of n, including 1 and n itself — what the calculator returns as 'sum of divisors'. φ(n) is Euler's totient: the count of integers from 1 to n that share no factors with n. Both are multiplicative functions built from the prime factorisation, but they answer different questions. σ is about divisor structure; φ is about coprimality and shows up in the Fermat-Euler theorem and RSA key generation.
Informational only. Not personalised financial, legal, or tax advice.