Factorial Calculator Guide: Understanding N! and Permutations
Quick answer
Learn about factorials, how they work, their role in permutations and combinations, and practical applications in mathematics. This guide answers that in plain language, with the practical steps first and the background afterwards.
Key facts
| What this article covers | Learn about factorials, how they work, their role in permutations and combinations, and practical applications in mathematics. |
|---|---|
| Topic | Math |
| Reading time | 10 min read |
| Published | April 10, 2026 |
| Written by | The SimpleCounter editorial team, who build and use these counting tools. |
| Cost of the tools mentioned | Free, with no account required. |
A factorial, written as n!, is the product of every whole number from n down to 1. Five factorial (5!) is 5 x 4 x 3 x 2 x 1 = 120. It looks like a simple multiplication exercise, but factorials grow so fast that they hit numbers larger than the count of atoms in the observable universe before you even reach 100!, which is exactly why they show up in probability, cryptography, and computer science algorithm analysis.
The Definition and the One Special Case
For any positive integer n, n! = n x (n-1) x (n-2) x ... x 2 x 1. By definition, 0! = 1, not 0, which trips people up until they see why: factorials count arrangements, and there is exactly one way to arrange zero items (do nothing), so the count is 1, not 0. This convention keeps formulas involving factorials, like combinations and permutations, working correctly at the boundary case of zero items.
How Fast Factorials Actually Grow
| n | n! |
|---|---|
| 5 | 120 |
| 10 | 3,628,800 |
| 13 | 6,227,020,800 |
| 15 | 1,307,674,368,000 |
| 20 | 2,432,902,008,176,640,000 |
| 25 | about 1.55 x 10^25 |
| 52 | about 8.07 x 10^67 |
That last row is not arbitrary: 52! is the number of ways to arrange a standard deck of 52 playing cards. It is such a large number that every time you thoroughly shuffle a deck, you are almost certainly creating an arrangement that has never existed before in the history of card games, since 52! vastly exceeds the estimated number of seconds since the Big Bang.
Permutations: Order Matters
The number of ways to arrange r items chosen from a set of n items, where order matters, is given by nPr = n! / (n-r)!. If you have 8 runners in a race and want to know how many possible orderings exist for gold, silver, and bronze medals, you calculate 8P3 = 8! / (8-3)! = 8! / 5! = 40,320 / 120 = 336. There are 336 distinct ways those three medals could be awarded among 8 competitors.
Combinations: Order Does Not Matter
When you only care which items are chosen, not their order, you use combinations: nCr = n! / (r! x (n-r)!). Choosing 6 numbers from a 49-number lottery pool has 49C6 = 49! / (6! x 43!) = 13,983,816 possible combinations, which is exactly why your odds of winning a 6/49 lottery jackpot are roughly 1 in 14 million. This same combination formula is behind probability calculations in card games: the number of distinct 5-card poker hands from a 52-card deck is 52C5 = 2,598,960.
Where Factorials Show Up Outside Textbooks
- Route and scheduling optimization: the traveling salesman problem for n cities has (n-1)!/2 possible routes to check exhaustively, which is why even 20 cities create more possible routes than can be brute-forced in a human lifetime.
- Cryptography and password entropy: the number of ways to arrange characters in certain cipher and shuffle systems relies directly on factorial growth.
- The Taylor series expansion, used to approximate functions like sine, cosine, and e^x in calculus, has a factorial in the denominator of every term, which is what makes the series converge.
- Probability puzzles like the birthday problem (how many people need to be in a room before two share a birthday) rely on factorial-based permutation counts.
Why Calculators Struggle Past a Certain Point
Standard double-precision floating point numbers, the format most calculators and programming languages use internally, can only represent numbers accurately up to around 1.7 x 10^308. Since 170! is already close to that ceiling (roughly 7.26 x 10^306), most basic calculators return an overflow error or "Infinity" for 171! and beyond. Specialized tools that use arbitrary-precision arithmetic (common in programming languages like Python) can compute factorials of much larger numbers, but the results become massive strings of digits rather than practical numbers to work with.
Calculate a Factorial or Permutation Instantly
Our free factorial calculator computes n! for any value you enter, along with permutation and combination results, so you do not have to multiply out a chain of a dozen or more numbers by hand.
How this page relates to the rest of the site
- Type of
- Guide
- Related tools
- Calculators and converters
- Published by
- SimpleCounter
Related articles
Fraction Calculator Guide: Operations with Fractions
Master fraction arithmetic with step-by-step examples.
Average Calculator: Mean, Median, Mode Explained
Learn the differences between mean, median, mode, and range with examples.
Square Root Calculator Guide: Perfect Squares
Learn about square roots, perfect squares, and cube roots.
Get Counting Tips in Your Inbox
Subscribe for productivity tips, counting techniques, and new feature updates.
No spam, unsubscribe anytime.