Factorial Calculator

Calculate n! instantly, even for large numbers. See the full multiplication breakdown and learn where factorials appear in probability and combinatorics.

Enter a non-negative whole number to compute its factorial.


10! = —

Factorial growth chart showing how quickly n! increases
Factorial growth chart showing how quickly n! increases

How to Use the Factorial Calculator

A factorial, written n!, multiplies every positive whole number from 1 up to n. Factorials show up in probability, arrangements, and many counting problems, and the numbers get enormous very quickly. This calculator handles the arithmetic for you and shows the working.

  1. Enter n. Type any whole number from 0 to 170. The calculator caps at 170 because 171! is too large for standard computer numbers to store.
  2. Press Calculate. Results update live as you type, so you can experiment with different values.
  3. Read the breakdown. You will see the multiplication chain (for example 5 x 4 x 3 x 2 x 1) and the final value.
  4. Try the edges. Enter 0 to confirm that 0! equals 1 by definition, then try 20 to see how fast factorials explode.

Factorial Formula Explained

The definition is simple: n! = n x (n-1) x (n-2) x … x 2 x 1. So 5! = 5 x 4 x 3 x 2 x 1 = 120. Two special cases matter. First, 0! = 1 by definition, which keeps formulas in combinatorics consistent. Second, factorials are only defined for non-negative whole numbers in basic use.

Factorials grow faster than almost anything you meet in school math. Compare: 10! is 3,628,800 (about 3.6 million), 15! passes one trillion, and 20! is roughly 2.43 quintillion. This explosive growth is why factorials dominate counting problems: the number of ways to arrange just 10 distinct books on a shelf is already over 3.6 million.

Worked Example

Compute 6!. Write the chain: 6 x 5 x 4 x 3 x 2 x 1. Multiply left to right: 6 x 5 = 30, 30 x 4 = 120, 120 x 3 = 360, 360 x 2 = 720, 720 x 1 = 720. So 6! = 720. In real terms, that means 720 different orders exist for arranging six people in a line. Enter 6 above to verify.

Double Factorials and Other Factorial Variations

The regular factorial multiplies every integer from 1 to n, but mathematics uses a few close relatives that are worth knowing — they come up in statistics, geometry, and combinatorics problems.

Double factorial (n!!) multiplies every other number: even n counts down through the even numbers, odd n through the odd numbers. So 8!! = 8 × 6 × 4 × 2 = 384, and 7!! = 7 × 5 × 3 × 1 = 105. Double factorials appear in formulas for the volume of high-dimensional spheres and in some probability calculations. They are not the same as (n!)! — a common mix-up.

Subfactorial (!n), also called the derangement number, counts how many ways n items can be rearranged so that none of them stays in its original position. !4 = 9, which answers the classic puzzle: four people each pick up a hat at random — there are 9 ways nobody gets their own hat back. This calculator works with ordinary single factorials, which is the form used in almost every school and college problem.

Trailing Zeros and Digit Counts

Two questions come up constantly with large factorials: how many zeros sit at the end, and how many digits does the answer have? Both have quick answers.

Trailing zeros come from factors of 10, and each 10 needs one 2 and one 5. Since factors of 2 are plentiful, you just count the factors of 5: floor(n/5) + floor(n/25) + floor(n/125) + … For 25!, that is 5 + 1 = 6 trailing zeros. For 100!, it is 20 + 4 = 24. So even without computing the whole number, you know 100! ends in exactly 24 zeros.

The number of digits grows fast: 10! has 7 digits, 20! has 19 digits, and 100! has 158. This is why the calculator caps the input at 170 — beyond that, factorials exceed what standard computer arithmetic can store.

Factorial Values at a Glance

n n! n n!
0 1 8 40,320
1 1 9 362,880
2 2 10 3,628,800
3 6 11 39,916,800
4 24 12 479,001,600
5 120 13 6,227,020,800
6 720 14 87,178,291,200
7 5,040 15 1,307,674,368,000

Frequently Asked Questions

What is 0! and why does it equal 1?

By definition, 0! = 1. This convention keeps formulas like combinations consistent — for example, choosing all n items from n gives n!/(n!(n-n)!) = 1, which only works if 0! = 1.

Why do factorials grow so fast?

Each step multiplies by a larger number, so growth compounds. Adding just one to n multiplies the previous factorial by the new n. By 20!, you are already past 2 quintillion.

What is the largest factorial this calculator handles?

Up to 170!. Beyond that, values exceed the largest number standard floating-point arithmetic can represent (about 1.8 x 10^308).

Where are factorials used in real life?

In permutations (arranging items), combinations (choosing groups), probability distributions like Poisson and binomial, and algorithm analysis where sorting can take n log n steps.

What is the difference between n! and n^n?

n! multiplies 1 through n, while n^n multiplies n by itself n times. For n = 5: 5! = 120, but 5^5 = 3125. Factorials grow slower than n^n but faster than 2^n.

What is a double factorial (n!!)?

The double factorial multiplies every other number instead of every number: 8!! = 8 × 6 × 4 × 2 = 384 for even n, and 7!! = 7 × 5 × 3 × 1 = 105 for odd n. It appears in formulas for high-dimensional sphere volumes and some probability calculations.

How many trailing zeros does 100! have?

Exactly 24. Count factors of 5: floor(100/5) + floor(100/25) = 20 + 4 = 24. Each 5 pairs with a 2 to make a factor of 10, and factors of 2 are always plentiful.

Is there a factorial of a negative number?

No — factorials of negative integers are undefined. The gamma function extends the idea to non-integers (for example, (1/2)! equals about 0.886), but on the negative integers it has no value.

Related Calculators

Counting arrangements? The Scientific Calculator handles powers and roots for related math. For probability work, try the Statistics Calculator.

Worked factorial example with step-by-step multiplication
Worked factorial example with step-by-step multiplication

Scroll to Top