Factorial Calculator

The product of every whole number up to n, and how fast it grows.

Factorial
Adjust the inputs

Your result updates live as you type.

A factorial multiplies every whole number from one up to n. It counts the arrangements of n distinct items, which is why it appears throughout combinatorics: ten books can sit on a shelf in 3,628,800 orders, and fifty-two cards can be shuffled in more ways than there are atoms in our galaxy.

Factorial growth outruns exponential growth completely. Two to the power twenty is about a million, while twenty factorial is about 2.4 quintillion. This page reports the number of digits alongside the value, because past about twenty the digit count is the more comprehensible figure. Zero factorial is defined as one, which is not arbitrary — it is the only value that keeps the recurrence and the combination formulas consistent.

Below the calculator sits the factorial values and digit counts table: 10 rows — 0 at one end, 100 at the other — which is usually faster than entering a value you have seen before. Nothing has to be entered to see it work: the default for number (n) is 12, and the output recomputes the moment that changes. The result is also read against 4 bands, from small at the low end to astronomical at the high end, each with a note on what that range means in practice. The pages people most often open next are Odds to Probability Calculator and Permutations Calculator.

The formula

n! = n × (n − 1) × (n − 2) × ... × 2 × 1
n
The whole number to factorialise
n!
The product of all whole numbers up to n
0!
Defined as 1

How it works, step by step

  1. Enter a whole number from 0 to 170.
  2. The gauge shows the factorial.
  3. The digit count and growth ratio appear below.
  4. Above 170 the result exceeds double-precision range.

Worked examples

Twelve factorial

12! = 479,001,600, which is the number of ways to arrange twelve distinct objects in a row. It has 9 digits.

How quickly it outruns exponentials

2 to the power 20 is 1,048,576, while 20! is 2,432,902,008,176,640,000 — about 2.32e+12 times larger. Factorial growth wins decisively past about n = 4.

Checking the 15 row

The reference table lists n = 15, giving n!: 1,307,674,368,000, Digits: 13, Versus 2 to the power n: 3.991e+07×. Entering that above should reproduce the same figures — if it does not, the input is being read differently to the way the table assumes.

How to read your score

0–1,000SmallEasily computed and written out in full.
1,000–10,000,000ModerateLarge but still readable as a number.
10,000,000–—Very largeBetter described by its digit count.
—–—AstronomicalBeyond any physical quantity.

Frequently asked questions

Why is zero factorial equal to one?

Because there is exactly one way to arrange nothing, the empty arrangement. It is also the only value that keeps n! = n × (n−1)! and the combination formula consistent.

Can I take the factorial of a fraction?

Not with this formula, but the gamma function extends factorials to all real and complex numbers. Gamma of n plus one equals n factorial for whole numbers.

Why does it stop at 170?

171! exceeds the largest number double-precision floating point can represent, so the result would simply be infinity.

Where do factorials show up in practice?

In counting arrangements, in the denominators of combination and permutation formulas, in Taylor series, and in the Poisson distribution.

What do the bands under the factorial mean?

They label the figure so it can be read without a reference point of your own: Small from 0 to 1,000; Moderate from 1,000 to 10,000,000; Very large from 10,000,000 upwards; Astronomical. The band is a reading aid only — the number itself is exact, and a value sitting just over a boundary is not meaningfully different from one just under it.

What formula does the Factorial Calculator use?

It computes n! = n × (n − 1) × (n − 2) × ... × 2 × 1, where n is the whole number to factorialise; n! is the product of all whole numbers up to n; 0! is defined as 1. The same expression is printed on the page above the inputs, so the result can be reproduced by hand or in a spreadsheet.

Factorials and their scale

Factorial values and digit counts
nn!DigitsVersus 2 to the power n
011
1110.5×
512033.75×
103,628,80073544×
12479,001,60091.169e+05×
151,307,674,368,000133.991e+07×
202,432,902,008,176,640,000192.32e+12×
302.652529e+32332.47e+23×
503.041409e+64652.701e+49×
1009.332622e+1571587.362e+127×

By n = 100 the factorial has 158 digits.

Related calculators