Factorial Calculator
Enter a whole number to get n! with every digit, how many digits it has, how many zeros it ends in, and the double factorial n!! and subfactorial !n.
n! means n × (n - 1) × (n - 2) × … × 1, and 0! is 1.
Worked examples
A small factorial
10!
3,628,800
It ends in two zeros because 10 contains two factors of five.
A large factorial
20!
2,432,902,008,176,640,000
19 digits, more than a basic calculator can show exactly.
About Factorial Calculator
The factorial of a whole number n, written n!, is the product of all the whole numbers from 1 up to n. So 5! is 5 × 4 × 3 × 2 × 1, which is 120. Factorials count the ways of arranging things: five different books can stand on a shelf in 120 different orders. They grow extremely fast, and 20! already has 19 digits, which is more than most calculators show correctly.
This page uses whole-number arithmetic, so every digit is right, even for 10,000!, which has over 35,000 digits. You also get the number of digits, the number of zeros at the end, found by counting factors of five, the scientific notation, the double factorial n!!, which multiplies every second number, and the subfactorial !n, which counts the rearrangements of n items in which nothing stays in its original place. A copy button takes the full digits to a document or spreadsheet.
How to use Factorial Calculator
- Enter a whole number from 0 to 10,000.
- Read the factorial in the large box. For long answers it appears in scientific notation.
- Check the digit count, trailing zeros and the double factorial and subfactorial below.
- Press Copy to take every digit of a long answer elsewhere.
Common uses
- Counting arrangements and orderings
- Working out permutations and combinations by hand
- Probability and series questions
- Checking how large a factorial grows
Frequently asked questions
What is 0 factorial?
It is 1. There is exactly one way to arrange nothing, and defining it this way keeps formulas for combinations and series consistent.
Why does the answer end in zeros?
Each factor of 10 in the product needs a 2 and a 5, and there are always more 2s than 5s, so the zeros are counted by the number of 5s. 10! ends in two zeros, and 100! ends in 24.
What is a double factorial?
It is the product of every second number counting down from n. So 9!! is 9 × 7 × 5 × 3 × 1, which is 945. It is not the factorial of a factorial.
What is a subfactorial?
The subfactorial !n is the number of derangements: ways to rearrange n items so that no item ends up in its original place. For 5 items there are 44.
Why is there a limit of 10,000?
Beyond that the answer has too many digits to show and copy comfortably. Up to 10,000 the result is exact.