How it works
The factorial of n, written n!, is the product of every whole number from 1 to n. 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition 0! = 1.
Factorials count arrangements: there are 10! = 3,628,800 ways to order 10 different books on a shelf. They grow extremely fast: 70! already exceeds 10100.
This calculator uses exact big-integer arithmetic, so every digit is correct even for 1000!, which has 2,568 digits.
Formula
n! = n × (n − 1) × … × 2 × 1; 0! = 1; trailing zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …
Questions people ask
Why is 0! equal to 1?
There is exactly one way to arrange zero objects (do nothing). It also keeps formulas consistent: n! = n × (n − 1)!, so 1! = 1 × 0! requires 0! = 1.
How do I count the trailing zeros of n!?
Each trailing zero comes from a factor of 10 = 2 × 5, and 5s are the scarcer factor. Add ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …; for 100! that is 20 + 4 = 24.
Can you take the factorial of a negative number or a fraction?
Not with the ordinary definition. The gamma function extends it to non-integers (Γ(n + 1) = n!), but it is undefined at negative integers.