The factorial of n, written n!, is the product of every whole number from n down to 1. So 4! = 4 × 3 × 2 × 1 = 24. A consistent definition sets 0! = 1, and factorials grow so quickly that they anchor most of counting and probability.
Key Takeaways
5! = 120,10! = 3,628,800, and20! = 2,432,902,008,176,640,000.0! = 1: the recursionn! = n × (n − 1)!forces it.- Factorials climb fast:
6! = 720,7! = 5,040, and8! = 40,320.- On the calculator, type
5!and press Enter →= 120.
What a factorial is
The factorial counts down. For a whole number n, multiplying every integer from n down to 1 gives n!, read as “n factorial”.
Worked example 1: computing small factorials. 3! = 3 × 2 × 1 = 6. 4! = 4 × 3 × 2 × 1 = 24. 5! = 5 × 4 × 3 × 2 × 1 = 120. On the calculator, 4! → = 24 and 5! → = 120. You can type the exclamation mark itself or use the n! key; both insert the same thing.
Factorials build on each other
Each factorial contains the one before it. Since 5! = 5 × 4 × 3 × 2 × 1 and 4! = 4 × 3 × 2 × 1, the relationship reads 5! = 5 × 4!. In general, n! = n × (n − 1)!. This single rule is behind every property that follows, including the value of 0!.
Worked example 2: the recursion in action. 10! = 10 × 9!. Given 9! = 362,880, you get 10! = 10 × 362,880 = 3,628,800. On the calculator, 9! → = 362,880 and 10! → = 3,628,800.
Why 0! equals 1
The recursion decides it. At n = 1 the rule says 1! = 1 × 0!, and since 1! = 1, it follows that 0! must equal 1. A combinatorial view agrees: there is exactly one way to arrange zero objects, by doing nothing. Both arguments land on the same value, and keeping 0! = 1 lets the formula n! = n × (n − 1)! hold at every step without exception.
A table of factorials
The first ten factorials, each reproducible on the calculator:
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.
Every row checks on the calculator: 7! → = 5,040 and 13! → = 6,227,020,800. Past the table the numbers leave everyday intuition behind. 13! has already passed ten figures, and 20! = 2,432,902,008,176,640,000, which exceeds the largest 64-bit integer. Results that large display in scientific notation, and the scientific notation calculator expands the compact form back into a full digit string.
Where factorials appear
Factorials count arrangements, and arrangements show up across probability. The number of ways to line up 5 books in a row is 5! = 120. Selecting and ordering subsets uses permutations, such as permutations(5,3) → = 60, and choosing subsets without ordering uses combinations, such as combinations(52,5) → = 2,598,960 possible five-card poker hands. Both formulas divide by factorials to strip out the arrangements they do not want, which is exactly what the permutations and combinations primer works through. The factorial calculator carries n!, nPr, and nCr together for that kind of job.
Worked example 3: a full deck. Ordering all 52 cards is 52 × 51 × 50 × … × 1, which is the definition of 52! written out. Type 52! and the calculator returns about 8.0658e+67, already in scientific notation. The product is real and the definition is unchanged; only the display has been shortened.
Factorials beyond whole numbers
The gamma function extends the factorial idea to numbers that are not whole. For whole n the connection reads Γ(n) = (n − 1)!, so the function smoothly fills in the gaps between the factorial values. It shows up in statistics and physics, but for counting, n! means exactly what the definition says, and no extension is needed.
Frequently asked questions
Why is 0! equal to 1?
Because the rule n! = n × (n − 1)! works at n = 1 only if 0! = 1. It is a definition chosen so the pattern never breaks.
How do I type a factorial on the calculator?
Type the number, then an exclamation mark, then press Enter: 5! → = 120. The n! key inserts the same mark.
Can I take a factorial of a fraction or a negative number?
Not with the plain n! operation, which is defined for whole numbers from 0 up. A decimal or negative input returns an error. The gamma function provides the extended version for math that needs it.
Why do factorials get so big so fast?
Each step multiplies by the next whole number, so the growth compounds. After 10! = 3,628,800, ten more steps reach 20! = 2,432,902,008,176,640,000, which is why the display eventually switches to scientific notation.