Factorial: Formula, Rules & Examples

A factorial is the product of a positive integer and every positive integer below it. Factorial notation uses an exclamation mark after the number.
For example:
5! = 5 × 4 × 3 × 2 × 1
Therefore:
5! = 120
In general:
n! = n × (n – 1) × (n – 2) × … × 2 × 1
for a nonnegative integer n.
Factorials grow extremely quickly and appear throughout arithmetic and number theory, particularly in counting arrangements, permutations, combinations, probability, and combinatorial formulas.
What Is a Factorial?
For a positive integer n, its factorial is the product of all positive integers from n down to 1.
For example:
4! = 4 × 3 × 2 × 1
4! = 24
Similarly:
6! = 6 × 5 × 4 × 3 × 2 × 1
6! = 720
The exclamation mark is not punctuation in this context. It is a mathematical operator.
The broader concept of factorials examines the n! sequence and its mathematical behavior, while this page focuses on calculating a factorial correctly and applying its principal rules.
Factorial Formula
The basic formula is:
n! = n × (n – 1) × (n – 2) × … × 3 × 2 × 1
For example:
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1
Calculate progressively:
7 × 6 = 42
42 × 5 = 210
210 × 4 = 840
840 × 3 = 2,520
2,520 × 2 = 5,040
Therefore:
7! = 5,040
Factorial Values From 0! to 10!
Some factorial values occur frequently enough to be useful to recognize.
| n | n! |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
| 5 | 120 |
| 6 | 720 |
| 7 | 5,040 |
| 8 | 40,320 |
| 9 | 362,880 |
| 10 | 3,628,800 |
The rapid increase is one of the defining features of factorial growth.
Why Is 0! Equal to 1?
By definition:
0! = 1
This may initially seem unusual because there are no positive integers from zero down to one to multiply.
One reason for the definition comes from the recurrence:
n! = n × (n – 1)!
Set:
n = 1
Then:
1! = 1 × 0!
Since:
1! = 1
we have:
1 = 1 × 0!
Therefore:
0! = 1
The value also keeps counting formulas consistent. There is exactly one way to arrange zero objects: the empty arrangement.
Why Is 1! Equal to 1?
The calculation contains only one positive factor:
1! = 1
So:
1! = 1
This means:
0! = 1!
even though 0 and 1 are different inputs.
Recursive Factorial Rule
A factorial can be related to the factorial immediately before it:
n! = n × (n – 1)!
For example:
8! = 8 × 7!
Since:
7! = 5,040
we get:
8! = 8 × 5,040
8! = 40,320
This recursive rule often avoids rewriting the entire descending product.
Reverse Recursive Rule
The same relationship can be rearranged:
(n – 1)! = n! / n
For example, if:
8! = 40,320
then:
7! = 40,320 / 8
7! = 5,040
This works when n is a positive integer.
How to Calculate a Factorial
Suppose you need:
6!
Start with 6 and multiply downward:
6! = 6 × 5 × 4 × 3 × 2 × 1
A convenient sequence is:
6 × 5 = 30
30 × 4 = 120
120 × 3 = 360
360 × 2 = 720
Multiplying by 1 does not change the result.
Therefore:
6! = 720
Example: Calculate 9!
Use the recursive relationship:
9! = 9 × 8!
From the known value:
8! = 40,320
we obtain:
9! = 9 × 40,320
9! = 362,880
Therefore:
9! = 362,880
Factorials Grow Very Quickly
Factorial growth becomes enormous even for moderate inputs.
Compare:
5! = 120
10! = 3,628,800
15! = 1,307,674,368,000
20! = 2,432,902,008,176,640,000
Increasing the input from 10 to 20 does much more than merely double the result.
This happens because every step multiplies the previous factorial by another increasingly large integer:
11! = 11 × 10!
12! = 12 × 11!
and so on.
Factorial vs. Exponent
A factorial is not the same as raising a number to a power.
For example:
5! = 5 × 4 × 3 × 2 × 1 = 120
but:
5⁵ = 5 × 5 × 5 × 5 × 5 = 3,125
A factorial multiplies different descending integers.
An exponent usually represents repeated multiplication of the same base.
Therefore:
n!
and:
n^n
are fundamentally different expressions.
Factorial and Factors Are Different Concepts
The words factorial and factor sound similar but refer to different ideas.
A factorial is an operation:
5! = 120
A factor is an integer that divides another integer exactly.
For example, the positive factors of 12 are:
1, 2, 3, 4, 6, 12
So finding factors of a number is not the same as calculating its factorial.
Factorials and Combinatorics
Factorials appear naturally in combinatorics because counting arrangements often creates a descending series of available choices.
Suppose 5 different books are placed on a shelf.
There are:
5 choices
for the first position.
Then:
4 choices
for the second.
Then:
3, 2, and 1
for the remaining positions.
Therefore:
Number of arrangements = 5 × 4 × 3 × 2 × 1
= 5!
= 120
So five distinct objects have 120 possible complete arrangements.
Factorial and Permutations
When order matters, factorials frequently appear in permutations.
The number of ordered arrangements of r objects selected from n distinct objects is:
nPr = n! / (n – r)!
For example, if 3 positions are filled from 7 candidates:
7P3 = 7! / 4!
Expand only the uncancelled factors:
7P3 = 7 × 6 × 5
7P3 = 210
Using factorial notation avoids writing unnecessarily long products.
Factorial and Combinations
Factorials also appear in combinations, where order does not matter.
The formula is:
nCr = n! / (r! × (n – r)!)
For example:
8C2 = 8! / (2! × 6!)
Cancel 6!:
8C2 = (8 × 7) / 2
= 56 / 2
= 28
Therefore:
8C2 = 28
The factorial terms correct for arrangements that would otherwise represent the same unordered selection.
Simplifying Factorial Fractions
Many factorial expressions become much easier when common factorial portions are cancelled before evaluating large numbers.
Consider:
10! / 8!
Expand:
10! = 10 × 9 × 8!
Therefore:
10! / 8! = (10 × 9 × 8!) / 8!
Cancel:
10! / 8! = 10 × 9
= 90
There is no need to calculate 10! or 8! separately.
Another Factorial Simplification
Simplify:
12! / 9!
Write:
12! = 12 × 11 × 10 × 9!
Therefore:
12! / 9! = 12 × 11 × 10
= 1,320
So:
12! / 9! = 1,320
This technique becomes increasingly useful as factorial inputs grow.
Factorial Quotient Rule
For integers:
n > k ≥ 0
the quotient:
n! / k!
can be written:
n × (n – 1) × … × (k + 1)
For example:
8! / 5!
becomes:
8 × 7 × 6
= 336
A frequent mistake is assuming:
8! / 5! = 3!
That is false.
The correct answer is:
336
not:
6
Factorial Products With Cancellation
Consider:
9! / (7! × 2!)
Expand:
9! = 9 × 8 × 7!
Then:
9! / (7! × 2!) = (9 × 8 × 7!) / (7! × 2)
Cancel:
= (9 × 8) / 2
= 72 / 2
= 36
This is also the calculation for:
9C2 = 36
Factorial and Prime Factorization
Large factorials contain many repeated prime factors.
For example:
6! = 720
Its prime factorization is:
720 = 2⁴ × 3² × 5
This can be understood from:
6! = 6 × 5 × 4 × 3 × 2 × 1
Breaking each factor into primes:
6 = 2 × 3
5 = 5
4 = 2²
3 = 3
2 = 2
Collecting powers gives:
2⁴ × 3² × 5
Prime structure becomes useful when studying divisibility properties of large factorials.
Factorials Are Highly Composite-Like Products
Once n is sufficiently large, n! is divisible by every positive integer from 1 through n.
For example:
8!
contains the factors:
1, 2, 3, 4, 5, 6, 7, 8
because each appears directly in the product.
Therefore:
8!
is divisible by every integer from 1 through 8.
This helps explain why factorial values have many divisors and are always composite numbers for integers n ≥ 3.
Is a Factorial Always Even?
For:
n ≥ 2
the factorial n! contains the factor 2.
Therefore every factorial from:
2!
onward is even.
Examples:
2! = 2
3! = 6
4! = 24
5! = 120
However:
0! = 1
and:
1! = 1
are odd.
When Does a Factorial End in Zero?
A decimal integer ends in zero when it contains a factor of 10:
10 = 2 × 5
Factorials contain many factors of 2, so the number of trailing zeros is controlled by how many factors of 5 occur.
For example:
5! = 120
contains one trailing zero.
And:
10! = 3,628,800
contains two trailing zeros.
A standard counting expression for trailing zeros in n! is based on:
floor(n / 5) + floor(n / 25) + floor(n / 125) + …
until the terms become zero.
This is a specialized property of factorial values rather than part of the basic factorial calculation.
Example: Trailing Zeros in 25!
Count factors of 5:
floor(25 / 5) = 5
Then account for the extra factor of 5 contained in 25:
floor(25 / 25) = 1
So:
Trailing zeros = 5 + 1
= 6
Therefore:
25! ends in 6 zeros
There are more than enough factors of 2 to pair with those six factors of 5.
Factorials and Common Factors
Factorial products create useful divisibility relationships.
For example:
6! = 720
and:
8! = 40,320
Since:
8! = 8 × 7 × 6!
every divisor of 6! also divides 8!.
This can make certain common factors obvious without producing complete factor lists.
Factorial and the Euclidean Algorithm
If factorial-derived values appear in a greatest-common-divisor problem, the Euclidean algorithm can still be used.
For example:
GCD(6!, 100)
First:
6! = 720
Then find:
GCD(720, 100)
Use repeated division:
720 = 100 × 7 + 20
100 = 20 × 5 + 0
Therefore:
GCD(720, 100) = 20
The factorial creates the first integer; the Euclidean algorithm finds its GCD with the second.
Factorial and Probability
Counting possible arrangements is often necessary before probabilities can be calculated.
For example, suppose five distinct cards are arranged randomly.
There are:
5! = 120
possible orders.
If only one order satisfies a specified condition and all orders are equally likely:
Probability = 1 / 120
Factorials therefore often appear in the denominator or numerator of exact probability expressions.
Factorial and Entropy
Information-theory entropy measures uncertainty from probabilities and logarithms, rather than directly calculating factorials.
However, factorials may appear indirectly in probability distributions whose possible outcomes involve permutations or combinations.
For instance, if a probability depends on counting arrangements among n objects, factorial expressions may first determine the number of outcomes. Those probabilities can then feed into an entropy calculation.
The two concepts remain mathematically distinct.
Is Factorial Defined for Negative Integers?
The ordinary factorial:
n!
is defined for nonnegative integers:
n = 0, 1, 2, 3, …
A negative integer such as:
(-3)!
does not have an ordinary factorial value.
The factorial concept can be extended through more advanced functions for many non-integer inputs, but those extensions have singularities at negative integers and are beyond the basic n! operation.
Is Factorial Defined for Decimals?
Ordinary elementary factorial notation is generally introduced for nonnegative integers.
For example:
4!
has the straightforward product:
4 × 3 × 2 × 1
A value such as:
4.5!
cannot be interpreted as an ordinary descending integer product.
Advanced mathematics extends factorial behavior through the gamma function, but that is a separate concept from basic factorial calculation.
Factorial of a Large Number
Consider:
12!
Use:
12! = 12 × 11!
From:
11! = 39,916,800
we get:
12! = 12 × 39,916,800
12! = 479,001,600
Therefore:
12! = 479,001,600
The rapid growth is why software and calculators may switch to scientific notation for comparatively modest factorial inputs.
Factorial and Scientific Notation
A very large factorial may be displayed approximately.
For example:
20! = 2,432,902,008,176,640,000
which can be written approximately as:
2.432902008 × 10¹⁸
The exact integer and its scientific-notation representation describe the same magnitude when sufficient digits are retained.
Common Factorial Mistakes
One common error is interpreting:
5!
as:
5 × 5
It actually means:
5 × 4 × 3 × 2 × 1
Another error is writing:
0! = 0
The correct value is:
0! = 1
A third mistake occurs when cancelling factorial expressions incorrectly.
For example:
10! / 8!
does not equal:
2!
Instead:
10! / 8! = 10 × 9 = 90
Another frequent error is confusing factorial notation with an exclamation mark that applies to an entire expression.
For example:
(3 + 2)!
means:
5! = 120
The addition must be evaluated first because it is inside parentheses.
Factorial and Order of Operations
Factorial notation generally applies to the value immediately before the exclamation mark.
For:
3! + 2
calculate the factorial first:
3! = 6
Then:
6 + 2 = 8
So:
3! + 2 = 8
For:
(3 + 2)!
calculate inside the parentheses:
3 + 2 = 5
Then:
5! = 120
The expressions are very different.
Double Factorial Is Different
An expression such as:
n!!
can denote a double factorial, which is not the same as applying the ordinary factorial twice.
For example:
7!! = 7 × 5 × 3 × 1
= 105
It does not mean:
(7!)!
Unless a problem specifically introduces double-factorial notation, ordinary factorial problems use a single:
!
How to Check a Factorial Calculation
The recursive relationship provides a simple check.
Suppose:
7! = 5,040
Then:
7! / 7
should equal:
6!
Calculate:
5,040 / 7 = 720
and:
6! = 720
The values agree.
Similarly:
6! × 7 = 720 × 7 = 5,040
so the calculation is confirmed.
Frequently Asked Questions
What is a factorial?
A factorial is the product of a nonnegative integer’s positive descending integers. For positive n:
n! = n × (n – 1) × … × 2 × 1
What does the exclamation mark mean in mathematics?
When placed after a nonnegative integer in this context, it denotes the factorial operation.
For example:
5! = 120
What is 0 factorial?
0! = 1
What is 1 factorial?
1! = 1
What is 5 factorial?
5! = 5 × 4 × 3 × 2 × 1 = 120
What is 10 factorial?
10! = 3,628,800
Why does factorial grow so fast?
Each new factorial multiplies the previous value by a larger integer:
n! = n × (n – 1)!
This repeated increasing multiplication causes very rapid growth.
Can you divide factorials without calculating them fully?
Yes. Cancel the shared factorial portion first.
For example:
9! / 7! = 9 × 8 = 72
Is factorial the same as exponentiation?
No. Factorial multiplies descending integers, while exponentiation repeatedly multiplies the same base for positive integer exponents.
Is factorial defined for negative integers?
Not under the ordinary factorial definition.
Where are factorials used?
They appear frequently in permutations, combinations, combinatorics, probability, counting problems, series, and more advanced mathematics.
Final Example
Simplify:
11! / (8! × 3!)
First expand only the necessary part:
11! = 11 × 10 × 9 × 8!
Substitute:
11! / (8! × 3!) = (11 × 10 × 9 × 8!) / (8! × 3 × 2 × 1)
Cancel 8!:
= (11 × 10 × 9) / 6
Calculate the numerator:
11 × 10 × 9 = 990
Then:
990 / 6 = 165
Therefore:
11! / (8! × 3!) = 165
The key to factorial calculations is recognizing the descending-product structure. Small values can be multiplied directly, while larger expressions are often simplified most efficiently by using:
n! = n × (n – 1)!



