How to use Factorial Calculator
- Enter a whole number from 0 to 20.
- Read the result and the full multiplication.
- 0! is 1, by definition and by necessity.
- The 20 limit is where exact integer representation ends in a double — beyond it, results would be silently wrong.
- Factorials of negative numbers are undefined; the gamma function extends to non-integers but not to negative integers.
Why it stops at 20
JavaScript numbers are IEEE-754 doubles, which hold integers exactly only up to 2⁵³, about 9.007 quadrillion. 20! is 2,432,902,008,176,640,000, comfortably inside that. 21! is 51,090,942,171,709,440,000, which is not — so a calculator that kept going would return confidently wrong digits. Refusing is better than lying. Beyond 20, exact factorials need arbitrary-precision arithmetic, which JavaScript provides through BigInt.
How fast it grows
Factorial growth outruns exponential growth. 10! is 3.6 million; 20! is 2.4 quintillion; 70! already exceeds the number of atoms in the observable universe. This is why brute-force algorithms with factorial complexity are hopeless: the travelling salesman problem checked exhaustively over 20 cities is 20! routes, which at a billion per second takes 77 years. Over 25 cities it outlives the solar system.
Why 0! is 1
It looks like a convention and it is forced. The recurrence n! = n × (n−1)! with 1! = 1 requires 0! = 1. Combinatorially, n! counts the arrangements of n objects, and there is exactly one way to arrange nothing — the empty arrangement. It also makes the binomial coefficient formula work at its edges without special cases, which is the practical reason it is defined that way rather than left undefined.
Where factorials are used
Permutations and combinations, which is most of discrete probability. The binomial coefficient n!/(k!(n−k)!) counting how many ways to choose k from n. Taylor series, where factorials sit in every denominator. And the gamma function, which extends factorial to non-integers and gives the famous result that the factorial of a half is half the square root of pi.
Frequently asked questions
What is a factorial?
What is 0! equal to?
Why is the limit 20!?
Why can I not calculate 21 factorial?
What is 0 factorial?
How big does a factorial get?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.