Skip to content
Math & Statisticsprobability

Factorial Calculator

Factorials up to 170, which is where a double-precision float stops being able to hold the answer.

Also called: n factorial calculator, 5 factorial.

n!
2,432,902,008,176,640,000

20! = 2,432,902,008,176,640,000.

Digits in the result
19
Method and background

How this is calculated

The product of every integer from one to n. Zero factorial is one by convention and by necessity. It is the empty product, and defining it otherwise would break the combination formula at its boundary.

n! = 1 * 2 * ... * n
n
The number

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

20!

Number
20

n!2,432,902,008,176,640,000

known value: 20! = 2,432,902,008,176,640,000. Written in exponential form because the decimal literal is past MAX_SAFE_INTEGER and would not round-trip through the parser.

Open this example