Overview

A factorial multiplies a whole number by every positive whole number below it. It's written with an exclamation mark, so 5! means 5 × 4 × 3 × 2 × 1, which is 120.

Enter a whole number from 0 to 20. Factorials grow very quickly, and larger values lose exact precision in a browser.

Worked examples

InputsResult
Number (n)77! = 5040
Show 3 more examples
Number (n)55! = 120
Number (n)1010! = 3628800
Number (n)2020! = 2432902008176640000

Factorial by number

With the calculator's starting values, the result is 5040. The table shows how it changes with the number.

Number (n)Factorial
424
5120
6720
7starting value5040
840320
9362880
103628800

How it works

Starting from 1, the number is built up by multiplying each integer up to n. By definition, 0! is 1. Factorials count arrangements: there are n! ways to put n different items in order.

The formula

n! = n × (n − 1) × … × 2 × 1
nA whole number from 0 to 20

Practical tips

  • 7! is 5,040.
  • 10! is 3,628,800, the number of ways to arrange 10 books on a shelf.
  • A shuffled 52-card deck has 52! possible orders, a number with 68 digits.

Frequently asked questions

Why is 0! equal to 1?

There's exactly one way to arrange nothing, and it keeps formulas such as combinations working.

Can I take the factorial of a negative or decimal number?

Not with this definition. The gamma function extends it to other values, but this calculator only takes whole numbers.

Where are factorials used?

Mostly in probability and counting, such as permutations and combinations, and in some series in calculus.