Factorial Calculator

Mathematics

Calculate factorial and permutations

A factorial, written n!, is the product of all positive integers from 1 up to n. For example, 5! (read "five factorial") equals 5 × 4 × 3 × 2 × 1 = 120. Factorials grow astonishingly fast — 10! is already 3,628,800, and 20! is a 19-digit number — which makes them notoriously difficult to compute by hand for anything beyond small values.

Factorials are the backbone of combinatorics, the branch of mathematics dealing with counting, arranging, and selecting objects. They are used to calculate permutations (the number of ways to arrange items in order) and combinations (the number of ways to choose items without regard to order), both of which show up constantly in probability, statistics, cryptography, and even everyday scenarios like figuring out how many ways a group of people can be seated or how many possible lottery number combinations exist.

Our factorial calculator computes n! for any non-negative integer instantly and exactly, avoiding the tedious repeated multiplication and the risk of arithmetic errors that come with large numbers. Enter a number, and get the precise factorial value along with related permutation and combination results, whether you're working through a statistics course, solving a probability problem, or just curious how large these numbers get.

Why Factorial Calculator Matters

Factorials underpin core areas of math, science, and computer science:

Probability and statistics: Calculating the odds of specific outcomes — like winning a lottery, dealing a certain poker hand, or arranging a sequence of events — relies directly on factorials through permutation and combination formulas.

Computer science: Factorials appear in algorithm analysis (some algorithms have O(n!) complexity), and combinatorial counting is essential to cryptography, hashing, and scheduling problems.

Academics: Factorials are introduced in Algebra II or Precalculus and are foundational to the binomial theorem, probability units, and discrete mathematics courses. They also appear on standardized tests covering combinatorics.

Everyday counting problems: How many different ways can you arrange books on a shelf, assign seats at a dinner table, or schedule a rotation of tasks? All of these questions are answered using factorials, permutations, and combinations.

Games and puzzles: The number of possible shuffled orderings of a standard deck of cards is 52!, an almost incomprehensibly large number, illustrating just how quickly factorial growth outpaces intuition.

The Factorial Calculator Formula, Explained

n! = n × (n-1) × (n-2) × ... × 2 × 1, with 0! = 1

Where n is a non-negative integer. The factorial of n is the product of every positive integer from 1 up to n. By mathematical convention, 0! is defined as 1, not 0 — this makes combinatorial formulas work consistently even in edge cases involving zero items.

Factorials are the building block for two closely related combinatorics formulas. Permutations, which count ordered arrangements, use the formula P(n, r) = n! / (n - r)!, representing the number of ways to arrange r items chosen from a set of n distinct items where order matters. Combinations, which count unordered selections, use the formula C(n, r) = n! / (r! × (n - r)!), representing the number of ways to choose r items from n where order does not matter.

Factorials only apply to non-negative integers — negative numbers and non-integers (like 3.5!) require the more advanced Gamma function, an extension of the factorial concept used in higher mathematics.

How to Use the Factorial Calculator: Step by Step

  1. Enter a non-negative integer

    Input the value of n you want the factorial of. It must be zero or a positive whole number — negative numbers and decimals are not valid for a standard factorial.

  2. Calculate the factorial

    The calculator multiplies every integer from 1 up to n and returns the exact product, even for large values of n.

  3. Optional: calculate permutations

    If you need to count ordered arrangements of r items chosen from n, enter both n and r to get P(n, r) = n! / (n - r)!.

  4. Optional: calculate combinations

    If order doesn't matter, enter both n and r to get C(n, r) = n! / (r! × (n - r)!), the number of unordered selections.

  5. Review the result

    For large n, the calculator returns the full exact integer value, which can grow to many digits very quickly.

Factorial Calculator Examples: Real-World Scenarios

1

Basic Factorial — Arranging Books

A student wants to know how many different ways 5 distinct books can be arranged on a shelf.

n:5

Calculation

5! = 5 × 4 × 3 × 2 × 1 = 120

Result

5! = 120, meaning there are 120 different possible orderings of the 5 books.

2

Larger Factorial — Card Arrangements

A statistics student needs 7! to calculate how many ways 7 people can be seated in a row for a probability problem.

n:7

Calculation

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

Result

7! = 5,040, showing how quickly factorials grow — just 2 more people than the previous example produces 42 times more arrangements.

3

Permutation — Choosing and Ordering a Subset

A coach needs to know how many ways to choose and rank a top-3 finishing order from a race with 5 competitors.

n:5
r:3

Calculation

P(5,3) = 5! / (5-3)! = 120 / 2! = 120 / 2 = 60

Result

There are 60 possible ways to award 1st, 2nd, and 3rd place among 5 competitors, since order matters here.

Common Mistakes to Avoid

  • Forgetting that 0! = 1, not 0 — this trips up many students since it seems counterintuitive at first, but it's essential for permutation and combination formulas to work correctly.
  • Trying to compute factorials of negative numbers or decimals using the basic formula — standard factorials are only defined for non-negative integers; use the Gamma function for other values.
  • Confusing permutations and combinations — use permutations when order matters (like race rankings) and combinations when order doesn't matter (like choosing a committee).
  • Underestimating how fast factorials grow — 13! already exceeds 6 billion, which can cause overflow errors in manual calculation or basic calculator apps.
  • Miscounting n and r in the permutation/combination formulas — n is always the total pool size, and r is the number being chosen or arranged, never the reverse.

Tips & Tricks

  • Factorials grow faster than exponential functions — by n = 20, the factorial already exceeds 2 quintillion, so always expect very large results for double-digit inputs.
  • Use the relationship n! = n × (n-1)! to compute factorials incrementally and spot-check calculator results, rather than multiplying from scratch every time.
  • When solving probability problems, first decide if order matters (use permutations) or doesn't matter (use combinations) before choosing which factorial-based formula to apply.
  • For very large factorials used in statistics (like in the binomial distribution), most of the terms cancel out algebraically before you need to compute a final numeric answer — simplify symbolically first when possible.

Factorials capture the explosive growth of arrangement possibilities, and they are the mathematical foundation for permutations, combinations, and much of probability theory. This calculator computes n! exactly for any non-negative integer, along with related permutation and combination values, so you can solve counting problems accurately without the risk of manual multiplication errors. Whether you're studying combinatorics, calculating probabilities, or just exploring how quickly these numbers grow, enter your value of n to get an instant, precise result. Use it alongside the permutation and combination tools below whenever a word problem asks you to count arrangements or selections rather than a plain factorial.

Factorial Calculator — Frequently Asked Questions

Related Calculators

Authoritative References

External links open in a new tab. OmniCalc.us is not affiliated with these organisations.

Related Calculators