Factorial Calculator
Enter a non-negative integer to compute its factorial instantly.
Updated
Factorial Calculator
Have you ever wondered how many ways five people can sit in a row, or how many orders a deck of cards can be shuffled into? That is what a factorial tells you. Our Factorial Calculator finds the exact factorial of any whole number from 0 to 10,000 as you type, shows the working, and copies every digit, so you never have to multiply long sequences of numbers by hand.
Quick answer
The factorial of a whole number n is the product of all whole numbers from 1 to n: n! = n × (n − 1) × … × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Enter any whole number above and the calculator shows its factorial instantly.
- By definition: 0! = 1 and 1! = 1
- Common values: 5! = 120, 10! = 3,628,800, 20! = 2,432,902,008,176,640,000
- Meaning: n! is the number of ways to arrange n different items in a row
- Only for whole numbers 0, 1, 2, …; decimals use the gamma function, x! = Γ(x + 1)
What Is a Factorial?
In mathematics, the factorial of a non-negative whole number is the product of all positive whole numbers less than or equal to it. It is written with an exclamation mark after the number, n!, read as “n factorial”. The symbol tells you to multiply every whole number from 1 up to n together: 4! means 4 × 3 × 2 × 1, and 6! means 6 × 5 × 4 × 3 × 2 × 1.
By convention, 0! = 1, even though there are no positive whole numbers to multiply. There is exactly one way to arrange nothing, and this definition keeps the formulas for permutations and combinations consistent.
Factorial Formula
n! = n × (n − 1)! 0! = 1
The second line is the recursive form: each factorial is the number times the factorial before it. If you know 5! = 120, then 6! = 6 × 120 = 720.
Example Calculations
5! = 5 × 4 × 3 × 2 × 1 = 120
7! = 7 × 6! = 7 × 720 = 5,040
10! = 3,628,800
How Fast Factorials Grow
Factorials start small but grow faster than any exponential such as 2n. 20! already has 19 digits, and 70! is larger than a googol (10¹⁰⁰).
| n! | Value | Digits |
|---|---|---|
| 0! | 1 | 1 |
| 1! | 1 | 1 |
| 2! | 2 | 1 |
| 3! | 6 | 1 |
| 4! | 24 | 2 |
| 5! | 120 | 3 |
| 6! | 720 | 3 |
| 7! | 5,040 | 4 |
| 8! | 40,320 | 5 |
| 9! | 362,880 | 6 |
| 10! | 3,628,800 | 7 |
| 12! | 479,001,600 | 9 |
| 15! | 1,307,674,368,000 | 13 |
| 20! | 2,432,902,008,176,640,000 | 19 |
| 25! | ≈ 1.551121 × 10²⁵ | 26 |
| 50! | ≈ 3.041409 × 10⁶⁴ | 65 |
| 100! | ≈ 9.332621 × 10¹⁵⁷ | 158 |
| 1,000! | ≈ 4.023872 × 10²⁵⁶⁷ | 2,568 |
Factorials in Permutations and Combinations
Factorials are the basis of counting problems:
- Arranging seats: 5 guests can sit in a row in 5! = 120 different ways.
- Passwords: the digits 1, 2 and 3, each used once, make 3! = 6 codes: 123, 132, 213, 231, 312 and 321.
- Anagrams: “APPLE” has 5 letters with P repeated, so it has 5! ÷ 2! = 60 distinct arrangements.
- Permutations (nPr): n! ÷ (n − r)! ways to arrange r of n items.
- Combinations (nCr): n! ÷ (r! × (n − r)!) ways to choose r of n items when order doesn’t matter.
Key Terms
- Factorial (n!)
- The product of all whole numbers from 1 to n.
- Permutation
- An arrangement where order matters, such as seating people in a row.
- Combination
- A selection where order doesn’t matter, such as picking a team.
- Gamma function (Γ)
- Extends the factorial beyond whole numbers: Γ(n + 1) = n!.
How to Use the Factorial Calculator
- Enter a whole number. Type a whole number from 0 to 10,000 in the “Whole number (n)” box. For example, type 5 to find 5!.
- Read the factorial. The factorial appears as you type, with the working underneath (for example 5! = 5 × 4 × 3 × 2 × 1 = 120). Results longer than 21 digits are shown in short form, such as 1.551121 × 10²⁵ for 25!, together with the number of digits.
- Copy the result. Press Copy to copy the exact factorial with every digit, even for large numbers. Press Clear or Esc to start again.
Example: enter 5 and the result is 120, with the working 5! = 5 × 4 × 3 × 2 × 1 = 120.
Where Factorials Are Used
Frequently Asked Questions (FAQs)
What is a factorial?
The factorial of a whole number n, written n!, is the product of all positive whole numbers from 1 up to n: n! = n × (n − 1) × … × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the number of ways to arrange n different items in a row.
What is 0! and why is it equal to 1?
0! equals 1 by definition. There is exactly one way to arrange zero items (do nothing), and defining 0! = 1 keeps formulas such as n! = n × (n − 1)! and the combinations formula working for every case. 1! is also 1.
What is 10 factorial?
10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800. Other common values: 5! = 120, 6! = 720, 7! = 5,040 and 20! = 2,432,902,008,176,640,000.
How do I calculate a factorial by hand?
Multiply the number by every whole number below it down to 1. For 6!, work through 6 × 5 = 30, 30 × 4 = 120, 120 × 3 = 360, 360 × 2 = 720, and 720 × 1 = 720. If you already know (n − 1)!, just multiply it by n: 7! = 7 × 720 = 5,040.
How large a factorial can the calculator handle?
Any whole number from 0 to 10,000, calculated exactly with every digit. Factorials grow very fast: 25! has 26 digits, 100! has 158 and 10,000! has 35,660. Long results are shown in short form (100! ≈ 9.332621 × 10¹⁵⁷), and Copy copies the full exact number. Most handheld calculators stop at 69!, and ordinary computer numbers lose exactness after 22!.
Can you take the factorial of a negative number or a decimal?
The factorial is only defined for whole numbers 0, 1, 2 and so on, so the calculator asks for one. For other numbers, mathematicians use the gamma function, which extends it: x! = Γ(x + 1). For example, Γ(1.5) = 0.5! ≈ 0.886227. The gamma function has no value at negative whole numbers.
How are factorials used in permutations and combinations?
The number of ways to arrange r items chosen from n is n! ÷ (n − r)! (permutations, nPr). The number of ways to choose r items when order does not matter is n! ÷ (r! × (n − r)!) (combinations, nCr). For example, choosing 2 of 5 items gives 5! ÷ (2! × 3!) = 120 ÷ 12 = 10 combinations.
How many trailing zeros does a factorial have?
Count the factors of 5, since each pairs with a 2 to make a 10: add ⌊n ÷ 5⌋ + ⌊n ÷ 25⌋ + ⌊n ÷ 125⌋ and so on. For 100!, that is 20 + 4 = 24 trailing zeros. 10! = 3,628,800 has 2.
Is the Factorial Calculator free?
Yes. It is completely free, needs no sign-up, and can be used as many times as you like.
Try our Factorial Calculator to find the exact factorial of any whole number instantly.