About this tool
The factorial n! multiplies all whole numbers from 1 to n: . It counts the ways to arrange n different objects in a row, and it appears throughout combinatorics, probability and series such as . Factorials grow faster than any exponential, so 70! already exceeds a googol. This calculator uses exact big-number arithmetic and shows how the digit count and trailing zeros come about.
How it works
Enter a whole number n to get n factorial, the product of every whole number from 1 to n. You also get the number of digits, the number of trailing zeros, the value in scientific notation and the double factorial n!!. Long results are summarized, and every digit can be expanded and copied.
For n above 10,000, the calculator gives a scientific-notation approximation from the log-gamma function, along with the exact digit count and trailing zeros. Decimal inputs such as 0.5 use the gamma function, which extends the factorial to non-integers.
Example
100! has 158 digits and begins 93326215443944. The number of trailing zeros equals the number of factors of 5, because factors of 2 are more plentiful: .
For a non-integer, .
Factorial table
Factorials from 0! to 20!, with 25!, 50! and 100!
| n | n! | Digits | Trailing zeros |
|---|---|---|---|
| 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 |
| 2 | 2 | 1 | 0 |
| 3 | 6 | 1 | 0 |
| 4 | 24 | 2 | 0 |
| 5 | 120 | 3 | 1 |
| 6 | 720 | 3 | 1 |
| 7 | 5,040 | 4 | 1 |
| 8 | 40,320 | 5 | 1 |
| 9 | 362,880 | 6 | 1 |
| 10 | 3,628,800 | 7 | 2 |
| 11 | 39,916,800 | 8 | 2 |
| 12 | 479,001,600 | 9 | 2 |
| 13 | 6,227,020,800 | 10 | 2 |
| 14 | 87,178,291,200 | 11 | 2 |
| 15 | 1,307,674,368,000 | 13 | 3 |
| 16 | 20,922,789,888,000 | 14 | 3 |
| 17 | 355,687,428,096,000 | 15 | 3 |
| 18 | 6,402,373,705,728,000 | 16 | 3 |
| 19 | 121,645,100,408,832,000 | 18 | 3 |
| 20 | 2,432,902,008,176,640,000 | 19 | 4 |
| 25 | 15,511,210,043,330,985,984,000,000 | 26 | 6 |
| 50 | 3.04141 × 10⁶⁴ | 65 | 12 |
| 100 | 9.33262 × 10¹⁵⁷ | 158 | 24 |
20! is the largest factorial that fits in a signed 64-bit integer, and 170! is the largest that fits in a double-precision floating-point number, about .
Assumptions and limits
Exact values are computed for whole numbers up to 10,000 (35,660 digits). From there up to 1,000,000, n! is approximated to six significant figures, while the digit count and trailing zeros stay exact. Decimal inputs between −1,000,000 and 1,000,000 use the gamma function to about ten significant figures; negative whole numbers have no factorial.
Frequently asked questions
Why is 0! equal to 1?
There is exactly one way to arrange zero objects, and an empty product equals 1. It also keeps formulas consistent: with gives , so .
How many trailing zeros does n! have?
Count the factors of 5 with Legendre's formula: . Each 5 pairs with one of the more common factors of 2 to make a 10. For 1000! that is .
What is the factorial of a decimal number?
Factorials of non-integers are defined with the gamma function: . For example and . The gamma function is undefined at 0 and the negative integers, so does not exist.
What is a double factorial?
The double factorial n!! multiplies every second number down to 1 or 2: and . It is not the factorial of a factorial.
How can I estimate a large factorial?
Stirling's formula is already within 1% for . The number of digits is .
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
nNumber (n) | decimal number, kept exactly as written | required |
Examples
?n=20?n=4.5
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="factorial_calculator"]