Factorial Calculator
Work out n! exactly, written out in full up to 20,000!. Also gives the number of digits and trailing zeros, Stirling’s approximation, the double factorial n!!, and x! for decimals through the gamma function.
How to Use
- Type n. Whole numbers up to 20,000 give the exact factorial; a decimal such as 0.5 gives x! through the gamma function.
- Choose n! or the double factorial n!!, which multiplies every other number.
- Read the value, how many digits it has and how many zeros it ends in.
- The table has the full number (click to copy), Stirling’s estimate and the prime factorisation of n!.
- The graph shows log₁₀ n! against 2ⁿ: factorials outgrow any exponential.
Worked Example
Finishing orders. 8 runners can cross the line in 8! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320 different orders: 8 choices for first, then 7 for second, and so on.
Trailing zeros of 100!. Every zero needs a 5 (2s are always more plentiful). The multiples of 5 up to 100 give ⌊100/5⌋ = 20, and the multiples of 25 give ⌊100/25⌋ = 4 more, so 100! ends in 24 zeros.
The common mistake: confusing n!! with (n!)!. 3!! = 3 × 1 = 3, a double factorial. (3!)! = 6! = 720 is something else entirely.
Show Work
Formulas
From Bell Ringing to the Gamma Function
Counting arrangements is old: the Jain text Anuyogadvāra-sūtra (around the 2nd century BC) lists the number of orders of objects, and 17th-century English change ringers worked out that 7 bells can ring 5,040 = 7! different changes. The exclamation mark notation is from Christian Kramp in 1808, chosen, he said, for convenience in printing.
In 1729 Leonhard Euler, answering a question from Daniel Bernoulli, found a way to define factorials between the whole numbers, the integral that became the gamma function. James Stirling’s 1730 approximation shows how fast n! grows; it is less than 1% off from n = 9 onwards.
About This Calculator
This calculator computes n! and n!! exactly with whole-number arithmetic, up to 20,000! (a 77,338-digit number), and x! for any decimal through the gamma function. Alongside the value it counts digits and trailing zeros, compares Stirling’s approximation, and lists the prime factorisation of n! up to n = 1000.
Everything runs in your browser; nothing is sent anywhere.
Related calculators: Permutation and Combination Calculator, Factoradic Converter, and Big Number Calculator.
Frequently Asked Questions
What is a factorial?
The product of every whole number from 1 up to n: 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the ways to put n different things in order: 5 books on a shelf can be arranged 120 ways, and a shuffled deck of 52 cards can be in 52! ≈ 8.07 × 10⁶⁷ orders.
Why is 0! equal to 1?
There is exactly one way to arrange nothing, and the pattern n! = (n + 1)! ÷ (n + 1) gives 0! = 1! ÷ 1 = 1. It also keeps formulas working: the number of ways to choose all n items, n! ÷ (n! × 0!), must be 1.
How many zeros does a factorial end in?
One for every factor of 10, and since 2s are plentiful, that means counting the 5s: ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …. For 100!: 20 + 4 = 24 trailing zeros. This is Legendre’s formula, which counts how many times any prime divides n!.
Can you take the factorial of a decimal?
Yes, through the gamma function: x! = Γ(x + 1), which matches n! at whole numbers and fills in the curve between them. 0.5! = √π / 2 ≈ 0.8862 and 1.5! ≈ 1.3293. Negative whole numbers have no factorial: the gamma function shoots off to infinity there.
What is a double factorial?
The product of every other number down to 1 or 2: 7!! = 7 × 5 × 3 × 1 = 105 and 8!! = 8 × 6 × 4 × 2 = 384. It is not (7!)!. Double factorials show up in integrals of powers of sine and in counting ways to pair up objects: 2n people can be split into pairs in (2n − 1)!! ways, 945 for 10 people.
How do I use the Factorial Calculator?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Arrangements
8 runners can finish in 8! = 40,320 orders.
Cards
A deck can be shuffled into 52! ≈ 8.07 × 10⁶⁷ orders.
Puzzles
100! ends in 24 zeros: 20 multiples of 5 plus 4 of 25.
Probability
10 people can be paired up in 9!! = 945 ways.
Statistics
Γ(0.5) = √π, which is where the √π in the normal distribution comes from.
Last updated: