CalculatorFree.net

Factor Calculator

Enter any positive integer to find all its factors, factor pairs, prime factorization, and whether it is prime. Step-by-step trial division work is shown.

What Are Factors?

A factor of a whole number n is any positive integer that divides n exactly, with no remainder. Factors always occur in pairs: if a divides n, then n/a also divides n. This is why factors are listed as pairs (1 × n, 2 × n/2, etc.).

The factors of 360, for example, are: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360 — a total of 24 factors. This makes 360 a highly composite number, which is why it was historically chosen for the number of degrees in a circle and the number of days in ancient calendar systems.

Finding Factors: Trial Division

The most straightforward method for finding all factors is trial division. You test each integer from 1 up to the square root of n. If a number divides n evenly, both the divisor and the quotient are factors.

You only need to check up to √n because factor pairs straddle the square root. If a × b = n and a ≤ b, then a ≤ √n ≤ b. Every factor below the square root has a corresponding factor above it.

Example: Find factors of 36
√36 = 6. Check divisors 1 through 6:
36 ÷ 1 = 36 ✓   36 ÷ 2 = 18 ✓   36 ÷ 3 = 12 ✓   36 ÷ 4 = 9 ✓   36 ÷ 5 = 7.2 ×   36 ÷ 6 = 6 ✓
Factors: 1, 2, 3, 4, 6, 9, 12, 18, 36

Prime vs. Composite Numbers

Every positive integer falls into one of three categories:

The Fundamental Theorem of Arithmetic states that every integer greater than 1 has a unique prime factorization. This is why prime numbers are called the "building blocks" of all integers.

Prime Factorization

Prime factorization decomposes a number into a product of prime numbers. The result is written using exponential notation when primes repeat: 360 = 2³ × 3² × 5.

Uses of prime factorization:

Factor Trees

A factor tree is a visual way to find the prime factorization of a number. Start with the number at the top. Draw two branches to any two factors. If a factor is composite, branch it again. Continue until all branches end in prime numbers. The primes at the leaves form the prime factorization.

Factor tree for 60:

       60
      /  \
     6    10
    / \   / \
   2   3  2   5
  

60 = 2 × 2 × 3 × 5 = 2² × 3 × 5

You always get the same prime factorization regardless of which pair of factors you start with — this is guaranteed by the Fundamental Theorem of Arithmetic.

Counting Factors from Prime Factorization

If you know the prime factorization, you can count the total number of factors without listing them all. For n = p1a1 × p2a2 × … × pkak:

Number of factors = (a1 + 1) × (a2 + 1) × … × (ak + 1)

Example: 360 = 2³ × 3² × 5¹. Number of factors = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24.

This formula works because each factor is formed by independently choosing an exponent for each prime from 0 up to the maximum: 20,1,2,3 gives 4 choices; 30,1,2 gives 3 choices; 50,1 gives 2 choices. 4 × 3 × 2 = 24 combinations.

Frequently Asked Questions

What is a factor of a number?

A factor of a number n is any positive integer that divides n exactly, leaving no remainder. For example, the factors of 12 are 1, 2, 3, 4, 6, and 12, because each of these divides 12 with no remainder. Factors always come in pairs: 1 × 12, 2 × 6, and 3 × 4. Every number has at least two factors: 1 and itself. Numbers with exactly two factors are prime numbers.

What is the difference between a prime and a composite number?

A prime number has exactly two distinct factors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13, 17. The number 1 is neither prime nor composite by definition. A composite number has more than two factors — meaning it can be divided evenly by at least one other number besides 1 and itself. Examples: 4 (factors: 1, 2, 4), 12 (factors: 1, 2, 3, 4, 6, 12), 100 (has 9 factors). Every composite number can be written as a product of prime numbers (its prime factorization).

What is prime factorization and how do you find it?

Prime factorization expresses a number as a product of its prime factors. Every integer greater than 1 has a unique prime factorization (the Fundamental Theorem of Arithmetic). To find it using trial division: divide the number by the smallest prime (2) as many times as possible, then try the next prime (3), and continue until the remaining value is 1. For 360: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1. Result: 360 = 2³ × 3² × 5.

How do you find the number of factors a number has?

If the prime factorization of n is p₁^a₁ × p₂^a₂ × ... × pₖ^aₖ, the total number of factors is (a₁ + 1) × (a₂ + 1) × ... × (aₖ + 1). For 360 = 2³ × 3² × 5¹: number of factors = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24. This formula works because each factor corresponds to choosing an exponent (from 0 up to the maximum) for each prime independently.

What is a perfect number?

A perfect number is a positive integer that equals the sum of all its proper factors (factors other than itself). The smallest perfect number is 6: its proper factors are 1, 2, and 3, and 1 + 2 + 3 = 6. The next is 28: 1 + 2 + 4 + 7 + 14 = 28. Perfect numbers are extremely rare — only 51 are known as of 2025, all of them even. Whether any odd perfect numbers exist is one of the oldest unsolved problems in mathematics.

Related Calculators