Factorial Calculator

Work out n! exactly, even for large n, plus combinations (nCr) and permutations (nPr). See the digit count, trailing zeros and scientific form.

Runs in your browserNo sign-upWorks offline
Your result—
Formula used
Shown here after you calculate
Rounded to
2 decimal places

What the Factorial Calculator does

The Factorial Calculator gives exact factorials, not rounded ones: 100! shows all 158 digits. It also works out combinations (how many ways to choose r items from n, when order does not matter) and permutations (when order does), which come up in probability, lotteries and seating plans.

How to use it

  1. Choose n!, Combinations nCr or Permutations nPr.
  2. Enter n, and r if needed. n can be up to 5,000.
  3. Read the answer with its number of digits and, for long results, the scientific form.
  4. For very long answers, copy every digit or download them as a text file.

Example

20! = 2,432,902,008,176,640,000, a 19-digit number with 4 trailing zeros, or about 2.432902 × 10^18. A 5-card poker hand drawn from 52 cards has 52C5 = 2,598,960 possibilities, and choosing a captain, vice-captain and wicket-keeper from 10 players in order gives 10P3 = 720 ways.

The formulas

  • n! = n × (n − 1) × … × 2 × 1, and 0! = 1
  • nPr = n! ÷ (n − r)!
  • nCr = n! ÷ (r! × (n − r)!)

Trailing zeros come from factors of 10, that is pairs of 2 and 5. There are always more 2s, so the tool counts the 5s: 100! has 20 + 4 = 24 trailing zeros.

Factorials from 0 to 15

nn!
01
11
22
36
424
5120
6720
75,040
840,320
9362,880
103,628,800
1139,916,800
12479,001,600
136,227,020,800
1487,178,291,200
151,307,674,368,000

A double factorial, written n!!, multiplies every second number instead: 7!! = 7 × 5 × 3 × 1 = 105 and 8!! = 8 × 6 × 4 × 2 = 384. Multifactorials skip more numbers in the same way. This tool works out the ordinary n!, so work those out by hand or step by step.

For arrangements and selections with repetition, use the Permutation and Combination Calculator.

Questions people ask

Why is 0! equal to 1?

There is exactly one way to arrange nothing, and the rule n! = n × (n − 1)! only works if 0! = 1.

When should I use combinations instead of permutations?

Use combinations when order does not matter, such as choosing a team. Use permutations when it does, such as first, second and third place.

Is the answer exact?

Yes. The tool uses whole-number arithmetic with no rounding, however many digits there are.

How big do factorials get?

Very quickly. 10! is 3,628,800, 20! has 19 digits and 100! has 158. That is why the tool counts the digits and shows a scientific form for long answers.

Is my input sent anywhere?

No. Even 5,000! is worked out in your browser and never leaves your device.

Related tools