Skip to content
CalcWorld

Browse all tools

Factorial Calculator

The factorial calculator multiplies every whole number from 1 to n: 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. It works for any n from 0 to 170, and 0! = 1 by definition.

Sources: Wikipedia, MDN Updated

Calculate the factorial of any non-negative integer and see the complete multiplication sequence.

How to calculate a factorial

6! (read "6 factorial") multiplies every whole number from 6 down to 1.

  1. Start with n: 6.
  2. Multiply by each smaller whole number in turn: 6 × 5 = 30, × 4 = 120, × 3 = 360, × 2 = 720.
  3. The final × 1 changes nothing, so 6! = 720.

The tool shows this running product for any input of 10 or less. Above 10 it shows only the expansion and the total, because the list would run to dozens of lines.

Columns for 1! to 6!: 1, 2, 6, 24, 120 and 720. Each is the one before it times the next whole number, so 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720.
Factorials grow fast: 6! is 720, and 10! is already 3,628,800.

Why 0! = 1

A factorial counts the ways to put n items in order. There is exactly one way to arrange no items, so 0! = 1, and one way to arrange one item, so 1! = 1. The calculator returns 1 for both by definition.

The same rule keeps the formula for combinations working when you choose all the items or none of them; the permutation and combination calculator uses it.

Factorial table from 0! to 12!

nn!nn!
0175,040
11840,320
229362,880
36103,628,800
4241139,916,800
512012479,001,600
6720

Why the calculator stops at 170

170! is about 7.26 × 10³⁰⁶, the largest factorial that fits in a JavaScript number. 171! is about 1.24 × 10³⁰⁹, which is more than Number.MAX_VALUE, roughly 1.8 × 10³⁰⁸.

Instead of returning Infinity, the tool rejects inputs above 170. Results this large are shown in powers of ten; the scientific notation converter explains the format.

Where factorials are used

Factorials count arrangements: n! orders of n items, and the building blocks of nPr and nCr. To see the groups instead of counting them, the all possible combinations generator lists them. More counting tools are on the statistics calculators page.

Factorial Calculator: FAQ

What is 10 factorial?

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

Can you take the factorial of a negative number or a fraction?

Not with this definition, which needs a whole number of 0 or more. The gamma function extends the idea to fractions, but this calculator does not use it.

How many ways can 5 people stand in a line?

5! = 120. Five choices for the first place, four for the second, and so on: 5 × 4 × 3 × 2 × 1.

Sources