Factorial Calculator
Calculate n! for any non-negative integer — instantly
Factorial Calculator
Calculate n! for any non-negative integer
Compute the factorial of a number (n!)
n! = n x (n-1) x (n-2) x ... x 2 x 1What is a Factorial Calculator?
A Factorial Calculator is a math tool that computes the factorial of a number, written as n! (pronounced "n factorial"). The factorial operation multiplies a whole number by every whole number below it down to 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
Factorials are extremely common in probability, statistics, algebra, and combinatorics. They help answer questions like "How many ways can I arrange these items?" or "How many different combinations are possible?" That's why factorials appear in formulas for permutations (arrangements) and combinations (selections).
Because factorial values grow very fast (even 20! is already a huge number), a calculator is the easiest way to get accurate results instantly without manual multiplication errors.
How to Use This Factorial Calculator
- Enter a number (n) -- Typically a non-negative whole number (0, 1, 2, 3, ...)
- Click "Calculate" -- The calculator computes n!
- Review the result -- The output is the factorial value
- Try other values -- Factorials grow quickly, so test small and large numbers to see the pattern
Tips:
- 0! equals 1 (this is a standard math rule)
- Factorials are usually defined for whole numbers. If you enter a negative number, it's typically invalid
- Large factorials may be displayed with commas or in scientific notation depending on the page formatting
Formulas
Factorial Definition (for non-negative integers)
n! = n × (n − 1) × (n − 2) × … × 3 × 2 × 1
1! = 1
2! = 2 × 1 = 2
3! = 3 × 2 × 1 = 6
Special Case
Rule: 0! = 1
This is defined by convention to keep formulas consistent
Recursive Form
Rule: n! = n × (n − 1)! for n ≥ 1
Example: 6! = 6 × 5!
Where Factorials Are Commonly Used
- Permutations: nPr = n! / (n − r)!
- Combinations: nCr = n! / (r! × (n − r)!)
Example Calculations
Example 1: Compute 5!
Calculation: 5 × 4 × 3 × 2 × 1 = 20 × 3 × 2 × 1 = 60 × 2 × 1 = 120
Result: 120
Example 2: Compute 0!
Rule: By definition, 0! = 1
Result: 1
Example 3: Compute 8!
Calculation: 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320
Result: 40,320
Example 4: Use factorials to compute a combination (10 choose 3)
Formula: 10C3 = 10! / (3! × 7!)
Calculation: (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120
Result: 120 ways
Frequently Asked Questions
What does "n!" mean?
"n!" means factorial. It's the product of all whole numbers from n down to 1. For example, 4! = 4 × 3 × 2 × 1 = 24.
Why is 0! equal to 1?
It's defined that way to keep math formulas consistent—especially in combinations and permutations. For example, the formula for combinations would break in common edge cases if 0! were not equal to 1.
Can I calculate the factorial of a negative number?
Factorials are not defined for negative integers in standard arithmetic. Most factorial calculators will reject negative inputs or return an error.
Why do factorial numbers get so large so quickly?
Factorials grow by repeated multiplication. Each step multiplies by a larger number (e.g., 10! is 10 times bigger than 9!). That rapid growth is why factorials become huge even for moderately sized inputs.
What's the difference between permutations and combinations?
Permutations count arrangements where order matters (ABC is different from ACB). Combinations count selections where order does not matter (ABC is the same group as ACB). Both formulas rely on factorials.
Want to add this factorial calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.
What Is a Factorial?
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials appear everywhere in mathematics — counting problems, probability, combinatorics (combinations and permutations), calculus (Taylor series), and the binomial theorem all rely on them. If you have ever asked how many ways you can arrange a set of objects, the answer almost certainly involves a factorial.
Factorials grow astronomically fast — 20! = 2,432,902,008,176,640,000. Even modest inputs produce enormous numbers, which is why computing them accurately requires care. This calculator handles large integers precisely, showing exact values for practical inputs and well-rounded approximations (using Stirling's formula) for very large n where exact computation becomes impractical.
How to Use the Factorial Calculator
- Enter any non-negative integer n in the input field.
- Click Calculate (or press Enter) to compute the result.
- Read the exact factorial value displayed below the input.
- Use the result in your permutation formula P(n,r) = n! / (n−r)! or combination formula C(n,r) = n! / (r! × (n−r)!) as needed.
Factorial Formula & Reference Table
Definition: n! = n × (n−1) × (n−2) × ... × 2 × 1
Recursive: n! = n × (n−1)!, with 0! = 1
Special cases:
0! = 1 (by definition)
1! = 1
2! = 2
5! = 120
10! = 3,628,800
20! = 2,432,902,008,176,640,000
Combinations: C(n,r) = n! / (r! × (n−r)!)
Permutations: P(n,r) = n! / (n−r)!0! = 1 is a convention that makes the formulas for combinations and permutations work correctly for edge cases — for example, choosing 0 items from n or choosing all n items from n. Without this convention, the formulas would break down at their boundaries.
Worked Examples
6! = 720 — Arranging 6 people in a line
If you need to seat 6 people in 6 chairs in a row, the number of distinct arrangements is 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. Each position has one fewer choice than the last, so the count multiplies down to 1.
C(10, 3) = 120 — Choosing 3 from 10
To find how many ways you can pick a 3-person committee from a group of 10, use C(10, 3) = 10! / (3! × 7!) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120. Order does not matter for combinations.
15! = 1,307,674,368,000
15! = 1,307,674,368,000 — over 1.3 trillion. This illustrates how rapidly factorials grow. A password system with 15 unique characters has more than a trillion possible orderings, making brute-force attacks computationally expensive.