Introduction
A factorial is what you get when you multiply a whole number by every positive number below it. For example, the factorial of 5 (written as 5!) equals 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! always equals 1. Factorials grow very fast — even small numbers can produce huge results.
Factorials are one of the most important building blocks in combinatorics, the branch of math that deals with counting. They help us figure out how many ways we can arrange or choose items from a group. You'll find them inside formulas for permutations, combinations, and probability. Use this factorial calculator to get instant, accurate results for any non-negative whole number.
How to use our Factorial Calculator
Enter a non-negative whole number or a factorial expression, and this calculator will give you the exact factorial result, scientific notation, digit count, and a step-by-step solution.
Simple Mode – Number Input: Type any non-negative whole number (like 5, 10, or 100) into the input field. The calculator will multiply that number by every whole number below it down to 1 and show you the full result. For example, entering 5 gives you 5! = 5 × 4 × 3 × 2 × 1 = 120. You can enter values up to 99,999.
Expression Mode – Factorial Expression Input: Type a math expression that uses factorials, such as 10!/8!, (3+2)!, or 6!/(3!×2!). This mode lets you divide, multiply, add, or subtract factorial values in a single calculation. Use the on-screen math keypad or your keyboard to build your expression.
Example Buttons: Click any of the pre-loaded example buttons like 5!, 0!, 20!, 10!/8!, or (3+2)! to instantly fill in the input and see the result. These are a quick way to explore how factorials work or test common problems.
Calculate Factorial Button: After entering your number or expression, click the "Calculate Factorial" button to run the calculation. You can also press Enter on your keyboard for the same result.
Reset Button: Click "Reset" to clear your input and return the calculator to its default state with 10! as the starting example.
Result Display: The answer appears in a highlighted result card showing the full factorial value with commas for easy reading, the total number of digits, and the value in scientific notation. For very large numbers, you can scroll through the result area to see every digit.
Copy Result Button: Click "Copy Result" to copy the exact numeric answer to your clipboard so you can paste it into other documents or calculators.
Step-by-Step Solution: Below the result, a step-by-step breakdown shows exactly how the factorial was computed. You can click "Show" or "Hide" to toggle this section on or off.
Common Factorials Reference Table: A built-in table at the bottom lists factorial values for commonly used numbers like 0!, 1!, 5!, 10!, 20!, 50!, and 100!, along with their digit counts, so you can quickly look up values without calculating.
What Is a Factorial?
A factorial is the product of a whole number and every whole number below it down to 1. We write it using an exclamation mark. For example, 5! (read as "five factorial") means 5 × 4 × 3 × 2 × 1, which equals 120. The factorial of 0 is defined as 1. This is not a random rule — it is needed to make many math formulas work correctly.
The Factorial Formula
The general formula for any non-negative integer n is:
n! = n × (n − 1) × (n − 2) × … × 2 × 1
Factorials grow extremely fast. While 5! is just 120, the value of 20! is already 2,432,902,008,176,640,000. By the time you reach 100!, the result has 158 digits. This rapid growth is one reason why factorials are so powerful in counting problems. If you need to understand how quickly values change, our percent change calculator can help quantify growth between consecutive factorials.
Why Factorials Matter in Combinatorics
Factorials are the backbone of combinatorics, which is the branch of math that deals with counting arrangements and selections. Here are the three most common places you will see them:
- Permutations: The number of ways to arrange n distinct objects in a line is exactly n!. For instance, there are 4! = 24 ways to arrange four books on a shelf. Use our permutation calculator to compute P(n, r) values directly.
- Partial permutations: The number of ways to pick and arrange r items from n items is P(n, r) = n! / (n − r)!. Our calculator handles expressions like 10!/8! for exactly this kind of problem.
- Combinations: The number of ways to choose r items from n items without caring about order is C(n, r) = n! / (r! × (n − r)!). You can compute expressions like 6!/(3!×2!) directly using Expression Mode above, or use our dedicated combination calculator for a streamlined approach.
Key Factorial Facts to Remember
- 0! = 1 — This is true by definition and ensures that formulas for combinations and permutations work when r equals 0 or n.
- Negative numbers do not have factorials. The factorial function is only defined for non-negative integers (0, 1, 2, 3, …).
- Recursive property: n! = n × (n − 1)!. This means you can find any factorial if you know the one before it. For example, 7! = 7 × 6! = 7 × 720 = 5,040.
- Factorials and division simplify nicely. When you divide one factorial by another, most terms cancel out. For example, 10!/8! = 10 × 9 = 90 because the 8 × 7 × 6 × … × 1 part cancels from the top and bottom.
Real-World Uses of Factorials
Factorials show up in many real-world situations. Probability problems use them to figure out the odds of events, such as the chance of drawing a specific hand in a card game. Computer scientists use them to measure how many possible orders a sorting algorithm might need to check. Scientists use them in statistical formulas and in series expansions like the Taylor series, where each term divides by a factorial. In statistics, factorials appear in hypothesis testing — tools like our chi-square calculator and p-value calculator rely on distributions built from factorial-based formulas. When analyzing data sets, you may also find factorials embedded in the calculations behind standard deviation, confidence intervals, and sample size determinations.
How to Use This Calculator
Simple Mode lets you type a single number and instantly get its factorial. Expression Mode lets you enter more complex expressions involving multiple factorials, multiplication, division, addition, and subtraction — perfect for computing permutations, combinations, or any formula that uses factorials. The calculator shows the full result, its scientific notation, digit count, and a step-by-step breakdown so you can follow the math yourself. For related mathematical operations, you might also find our percentage calculator or mean, median, mode calculator helpful in your work.