Factorial Calculator
Calculate factorials with step-by-step solutions, scientific notation for large values, and applications in permutations and combinations.
Result
Factorial
120
Calculate Factorial
Enter a non-negative integer (0-170)
5! = 120
(3 digits)
Step-by-Step Solution
Formula: n! = n x (n-1) x (n-2) x ... x 2 x 1
Special case: 0! = 1 (by definition)
5! = 5 x 4 x 3 x 2 x 1
5 x 4 = 20
20 x 3 = 60
60 x 2 = 120
120 x 1 = 120
Result: 5! = 120
Double Factorial
5!! = 15
5 x 3 x ... = 15
Subfactorial (Derangements)
!5 = 44
Number of permutations with no fixed points
Stirling's Approximation
118
Error: 1.6507%
Result
Factorial
120
?How Do You Calculate a Factorial?
Factorial of n (written n!) is the product of all positive integers from 1 to n: n! = n x (n-1) x (n-2) x ... x 2 x 1. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. Special case: 0! = 1 by definition. Factorials grow extremely fast and are used in permutations, combinations, probability, and Taylor series.
What is a Factorial?
The factorial of a non-negative integer n, denoted n!, is the product of all positive integers less than or equal to n. Factorials are fundamental in combinatorics for counting permutations and combinations, in probability theory, in calculus for Taylor series expansions, and in many areas of mathematics and science. The factorial function grows faster than exponential functions.
Key Facts About Factorials
- n! = n x (n-1) x (n-2) x ... x 2 x 1
- 5! = 5 x 4 x 3 x 2 x 1 = 120
- 0! = 1 (by definition)
- Factorials grow very fast: 10! = 3,628,800
- Used in permutations: P(n,r) = n!/(n-r)!
- Used in combinations: C(n,r) = n!/(r!(n-r)!)
- 20! has 19 digits, 100! has 158 digits
- Stirling approximation: n! is approximately sqrt(2 x pi x n)(n/e)^n
Try These Factorial Examples
Quick-start with common scenarios
Practice Mode
Test your skills with practice problems
Practice with 5 problems to test your understanding.
Related Math Tools
Explore similar calculators
Frequently Asked Questions
The factorial of n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. By convention, 0! = 1. Factorials count the number of ways to arrange n distinct objects.
There are two reasons: (1) Combinatorially, there is exactly one way to arrange zero objects - do nothing. (2) Mathematically, the recurrence n! = n x (n-1)! requires 0! = 1 for 1! = 1 x 0! to equal 1.
Factorials grow faster than any exponential function. 10! = 3,628,800 (7 digits), 20! = 2.4 x 10^18 (19 digits), 100! has 158 digits. By Stirling's approximation, n! is approximately sqrt(2*pi*n) x (n/e)^n.
The double factorial n!! multiplies every other number: n!! = n x (n-2) x (n-4) x ... down to 1 or 2. For example: 7!! = 7 x 5 x 3 x 1 = 105, and 8!! = 8 x 6 x 4 x 2 = 384.
The subfactorial !n counts derangements - permutations where no element is in its original position. For example, !3 = 2: the arrangements (2,3,1) and (3,1,2) are the only derangements of (1,2,3). Formula: !n = n! x sum of (-1)^k/k! from k=0 to n.
Last updated: 2025-01-15
Result
Factorial
120