Factorial Calculator
Calculate n! (n factorial) for a non-negative integer.
What is a factorial?
A factorial, written with an exclamation mark like 5!, means you multiply together every whole number from 1 up to that number. So 5! is 5 × 4 × 3 × 2 × 1, which comes to 120. Factorials answer the question "how many ways can I arrange these items in order," which is why they sit at the heart of permutations, combinations, and probability.
$$n! = n \times (n-1) \times \cdots \times 2 \times 1$$
One quirk worth remembering: 0! is defined as 1, not 0. That is a convention, but a useful one, because it keeps the combination and permutation formulas working correctly.
How to use this calculator
- Enter a non-negative whole number, such as 5 or 10.
- Click calculate to get the factorial value.
- Read the result, which shows \(n!\).
- If needed, compare the step-by-step multiplication to check your work.
The formula explained
The formula \(n! = n \times (n-1) \times \cdots \times 2 \times 1\) computes the product of all positive integers from \(n\) down to 1. By definition, \(0! = 1\).
- n = a non-negative integer input
- n! = the factorial of n, the product of all positive integers from n down to 1
Step by step method
- Start with the number you want, for example 5.
- Multiply it by the next smaller whole number until you reach 1.
- Write the final product as the factorial value.
Worked example
Problem. Find \(6!\).
- Write out the product: \(6! = 6 \times 5 \times 4 \times 3 \times 2 \times 1\).
- Multiply in order: \(6 \times 5 = 30\), \(30 \times 4 = 120\), \(120 \times 3 = 360\), \(360 \times 2 = 720\), \(720 \times 1 = 720\).
- So \(6! = 720\).
Answer. \(6! = 720\)
Tips and common mistakes
- Factorial only works for non-negative integers, so \(3.5!\) is not defined in this calculator.
- Remember that \(0! = 1\), not 0.
Frequently asked questions
Why is 0! equal to 1?+
There is exactly one way to arrange nothing: do nothing. Defining 0! as 1 reflects that, and it also keeps formulas like the combination formula from breaking when you divide by 0!.
Can you take the factorial of a negative number or a decimal?+
Not with the ordinary definition, which only works for non-negative whole numbers. There is an advanced extension called the gamma function that handles decimals and more, but the everyday factorial stays with whole numbers.
Why do factorials grow so fast?+
Each step multiplies by a larger number, so the total compounds quickly. By the time you reach 10! you are already past three million, and 20! has nineteen digits. This rapid growth is why factorials dominate counting problems.
More Mathematics Tools
Explore related calculators in this category
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Absolute Value Grapher
Plot y = |f(x)| and see the characteristic V-shape and reflections.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
You Might Also Like
Popular tools from other categories
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.