How it works
The factorial (Factorial) of a whole number n, written n!, is the product of every whole number from 1 up to n, so 4! is 1 x 2 x 3 x 4 = 24. Factorials count arrangements: n! is the number of ways to line up n different items. Enter a whole number from 0 to 170. The calculator also shows how many digits the result has, how many trailing zeros it ends with, and the double factorial n!!, which multiplies every second number. By definition 0! is 1. Above 170 the result overflows what computers can store exactly.
Formula
x n.
Double factorial n!! = n x (n - 2) x (n - 4) x ...
down to 2 or 1.
Trailing zeros = n ÷ 5 + n ÷ 25 + n ÷ 125, each rounded down.
Example
Example in plain words. The number 12.
12! = 479001600.
It has 9 digits.
Trailing zeros = 12 ÷ 5 rounded down = 2.
12!! = 12 x 10 x 8 x 6 x 4 x 2 = 46080.
Frequently asked questions
Why is 0! equal to 1?
There is exactly one way to arrange zero items: do nothing. Defining 0! as 1 also keeps every counting formula working.
What is the factorial used for?
Counting permutations and combinations, probability, and series in calculus. Any time you ask in how many orders things can appear, the answer involves a factorial.