Factorial

n! for non-negative integers.

10!
3,628,800

How to Use the Factorial Calculator

  1. Enter a non-negative integer value for **n** in the input field (e.g., 5, 10, 20).
  2. Click the **Calculate** button (or press Enter) to compute the result.
  3. Read the exact value of **n!** displayed in the result area.
  4. For large values of n (e.g., n = 100), note that the result is an extremely large integer — the calculator displays the full exact value.
  5. Use the **Reset** button to clear the input and start a new calculation.

Factorial Formula

n! = n × (n−1) × (n−2) × … × 2 × 1,   with 0! = 1

The factorial of a positive integer n is defined as the product of all positive integers from 1 through n. The special case 0! = 1 is defined by convention and is consistent with the empty product rule. The recursive definition states that n! = n × (n−1)!, with the base case 0! = 1.

  • n — The non-negative integer whose factorial you want to compute. Must be a whole number ≥ 0.
  • n! — The factorial of n — the product of all positive integers from 1 to n. For n = 0, the result is 1 by definition.
  • (n−1)! — The factorial of the previous integer, used in the recursive definition: n! = n × (n−1)!

Worked Example: 7!

n = 7
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040

Result: 7! = 5,040

What Your Result Means

The result 5,040 means there are 5,040 different ways to arrange 7 distinct objects in a sequence. This is the foundational use of factorials in permutations: the number of ways to order n items is always n!. Factorials grow extremely fast — for reference, 10! = 3,628,800 and 20! = 2,432,902,008,176,640,000.

Understanding Factorial

What Is a Factorial?

A factorial (denoted n!) is one of the most important operations in combinatorics, probability, and analysis. It represents the total number of ways to arrange n distinct objects in order.

Key Properties

  • 0! = 1 — defined by convention; consistent with the empty product and required for combinatorial formulas to work at n = 0.
  • 1! = 1
  • Recursive property: n! = n × (n−1)!
  • Factorial growth is super-exponential — values become astronomically large very quickly.

Where Are Factorials Used?

| Application | Formula | |---|---| | Permutations (ordered arrangements of n items) | n! | | Permutations of k items from n | n! / (n−k)! | | Combinations (binomial coefficients) | n! / (k! × (n−k)!) | | Probability of a specific ordering | 1 / n! | | Taylor series (e.g., e^x, sin x) | Denominators involve n! |

Factorial Growth Table

| n | n! | |---|---| | 0 | 1 | | 1 | 1 | | 2 | 2 | | 3 | 6 | | 4 | 24 | | 5 | 120 | | 6 | 720 | | 7 | 5,040 | | 10 | 3,628,800 | | 15 | 1,307,674,368,000 | | 20 | 2,432,902,008,176,640,000 |

The Gamma Function Extension

Factorials are defined only for non-negative integers, but mathematicians extended the concept to real and complex numbers using the Gamma function: Γ(n) = (n−1)!, so Γ(n+1) = n! for positive integers.

Common Mistakes

  • **Using negative integers:** Factorials are undefined for negative integers. Only n ≥ 0 is valid.
  • **Confusing n! with n×n:** n! is NOT the same as n squared or n times itself — it is the product of all integers from 1 to n.
  • **Forgetting 0! = 1:** A common error is assuming 0! = 0. By mathematical convention and the empty product rule, 0! = 1.
  • **Misapplying in combinations:** In the formula C(n,k) = n! / (k!(n-k)!), forgetting to divide by both k! and (n−k)! is a frequent mistake.
  • **Overflow in manual calculations:** For large n (e.g., n ≥ 13), factorials exceed typical 32-bit integer limits. Use this calculator for accurate large-number results.

Common Questions About Factorial

What is the factorial of 10?

10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800.

How do you calculate permutations using factorial?

The number of ways to arrange k items chosen from n distinct items (ordered) is P(n,k) = n! / (n−k)!. For example, P(5,3) = 5! / 2! = 120 / 2 = 60.

How do you calculate combinations using factorial?

C(n,k) = n! / (k! × (n−k)!). For example, C(6,2) = 720 / (2 × 24) = 720 / 48 = 15. This counts unordered selections.

What is a double factorial (n!!)?

The double factorial n!! is the product of all integers from 1 (or 2) up to n that have the same parity as n. For example, 7!! = 7 × 5 × 3 × 1 = 105. It is different from (n!)!.

Is there a formula to approximate large factorials?

Yes — **Stirling's approximation**: n! ≈ √(2πn) × (n/e)^n. It becomes increasingly accurate as n grows and is widely used in statistical mechanics and information theory.

Frequently Asked Questions

What is 0! (zero factorial)?

0! = 1. This is a mathematical convention consistent with the empty product rule and is essential for combinatorial formulas like C(n, 0) = 1 to hold correctly.

What is the largest factorial this calculator can compute?

This calculator can handle large non-negative integers and returns the exact full integer value of n!, with no approximation or scientific notation cutoff for reasonable inputs.

Is factorial defined for decimals or fractions?

Standard factorial (n!) is only defined for non-negative integers. For non-integer values, the Gamma function Γ(n+1) generalizes the concept, but that is a separate operation.

Why do factorials grow so fast?

Each step multiplies by a number one larger than before. By n = 20, the result already exceeds 2 quintillion. This super-exponential growth is why factorials appear in probability estimates involving astronomically small likelihoods.

How is factorial used in probability?

If you randomly shuffle a deck of 52 cards, the total number of possible orderings is 52!, which is approximately 8.07 × 10^67 — more than the estimated number of atoms in the observable universe.

Related Calculators

Sources

Only sources that have been reviewed are shown. Unverified citations are never published.

Spotted a calculation error?Report an Error
How this calculator works:MethodologyReport an Error

Report an issue or suggest a feature

Spotted an inaccuracy or have an idea to improve this calculator? Let us know.

We use cookies to operate the site, and — with your consent — to show advertising and measure usage. You can change your choice anytime in Cookie Settings.

Manage options