Back to home

Factor Calculator

Find all factors, factor pairs, prime factorization, and number of divisors for any positive integer up to 10,000,000.

Find Factors
Enter a positive integer (up to 10,000,000)

About Factors and Divisors

A factor (or divisor) of an integer n is any integer that divides n exactly with no remainder. For example, the factors of 12 are 1, 2, 3, 4, 6, and 12. Factors always come in pairs — for every factor f of n, n/f is also a factor. Pairs are typically listed from smallest to largest: (1, n), (2, n/2), and so on.

The most efficient algorithm for finding all factors is trial division up to √n. For each integer i from 1 to √n, if i divides n, then both i and n/i are factors. This runs in O(√n) time. A number is prime if its only factors are 1 and itself — in other words, it has exactly two distinct factors. All other integers greater than 1 are composite.

The number of divisors function τ(n) counts how many factors n has. If the prime factorization of n is p₁^e₁ × p₂^e₂ × … × pₖ^eₖ, then τ(n) = (e₁ + 1)(e₂ + 1) … (eₖ + 1). For example, 360 = 2³ × 3² × 5¹, so τ(360) = (3+1)(2+1)(1+1) = 24 divisors.

List every positive divisor of a positive integer, its factor pairs and its prime factorization. This helps check divisibility and understand how an integer is built from primes.

How it works

Test divisors from 1 through the square root. Whenever d divides n exactly, include both d and n/d; include the square-root divisor only once for a perfect square. Sort the list. Prime factorization uses repeated trial division, and the divisor count is the product of each prime exponent plus one.

Worked examples

For 36, test through √36=6. The pairs are 1×36, 2×18, 3×12, 4×9 and 6×6. The complete list is 1,2,3,4,6,9,12,18,36: nine factors.

36=2²×3², so the divisor-count rule gives (2+1)(2+1)=9. For prime 13 the only factors are 1 and 13, giving two divisors.

How to read your result

The largest accepted integer is 10,000,000, a workload limit well within exact JavaScript integer representation. Zero has infinitely many nonzero integer divisors and is rejected. Negative inputs are outside this positive-divisor interface; decimals are rejected, not truncated. One has the single positive divisor 1 and is neither prime nor composite.

For related calculations, try lcm calculator, gcf calculator, prime factorization calculator.

Frequently asked questions

What is the difference between factors and prime factors?

Factors are all positive integers that divide the number exactly. Prime factors are only the prime numbers in its multiplicative decomposition.

Why test only up to the square root?

Every larger divisor pairs with a smaller divisor. Once the smaller members through the square root have been checked, the pairs supply the complete list.

How many factors does a perfect square have?

A positive perfect square has an odd number of positive factors because its square-root divisor pairs with itself and is counted once.

Is 1 a prime number?

No. A prime has exactly two positive divisors. One has only the divisor 1 and has no prime factors.

Can I factor zero, negatives or very large integers?

This form accepts only positive whole numbers from 1 through 10,000,000. Zero, negatives, decimals and larger inputs receive a validation error.

Sources: Standard integer divisibility definitions; fundamental theorem of arithmetic and the divisor-count formula.

Last reviewed: October 27, 2026

Related Calculators

Explore more free online calculators to help with your calculations

Take this calculation further

Browse the math calculators collection for more tools in this subject.

For a related calculation, use Prime Factorization Calculator to break any integer into its prime factors. Shows exponential form, factor tree, and number of divisors. Alternatively, use Percentage Calculator to calculate percentages, percent change, and percentage of a number quickly and easily.

For the underlying method, read How Currency Conversion Works: Rates, Spreads, and Smarter Estimates or Percentage Calculations Made Clear: Change, Discounts, and Reverse Percentages.