Factorial Calculator (n!, Permutations nPr, Combinations nCr)
Precisely calculate the factorial n! of a non-negative integer n. Also supports permutations (nPr) and combinations (nCr), using BigInt for exact integer results with no digit limit. Includes a factorial reference table for 0-20.
Factorial reference table for 0-20
A table listing the values of 0! through 20!. Note that 20! already has 19 digits.
| 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 |
| 11 | 39,916,800 |
| 12 | 479,001,600 |
| 13 | 6,227,020,800 |
| 14 | 87,178,291,200 |
| 15 | 1,307,674,368,000 |
| 16 | 20,922,789,888,000 |
| 17 | 355,687,428,096,000 |
| 18 | 6,402,373,705,728,000 |
| 19 | 121,645,100,408,832,000 |
| 20 | 2,432,902,008,176,640,000 |
Tips
- Factorial (n!) is the product of every integer from 1 to n. For example, 5! = 5x4x3x2x1 = 120. By special definition, 0! = 1.
- Permutation (nPr) counts the ways to choose r items from n distinct items and arrange them in order. Because order matters, the result is always at least as large as the corresponding combination. For example, 5P2 = 5x4 = 20.
- Combination (nCr) counts the ways to choose r items from n distinct items without regard to order. For example, 5C2 = 10 (dividing 5P2 = 20 by the 2! = 2 ways to reorder the 2 chosen items).
- Factorials grow extremely fast: 20! already has 19 digits, and 100! has 158 digits. This tool uses BigInt, so it computes exact values with no rounding error even for large n.
- If n is too large (above 10,000), the tool returns an error due to computation cost — a practical limit to prevent the browser from becoming unresponsive.
Frequently Asked Questions
Side Note — Why is the factorial symbol an exclamation mark?
The "!" symbol for factorial is generally credited to the French mathematician Christian Kramp, who introduced it in a book published in 1808. Before that, mathematicians used a variety of ad hoc notations with no agreed-upon standard. Various explanations exist for Kramp's choice, but a popular one is that it captures the sense of "astonishment" at how quickly factorial values explode in size.
This explosive growth is also captured by Stirling's approximation (n! ~ sqrt(2*pi*n) * (n/e)^n), which is widely used for approximate calculations across statistics, probability theory, and combinatorics. For values of n too large to compute n! exactly, this approximation plays a genuinely practical role.
The ideas behind permutations and combinations underlie everyday probability problems, from calculating lottery odds to counting the number of ways to shuffle a deck of cards (a standard 52-card deck has 52! possible orderings, roughly 8x10^67). The combination count nCr also appears as the entries of Pascal's Triangle and is closely tied to the binomial theorem (the expansion of (a+b)^n).