Free factorial calculator
Calculate the factorial of any non-negative integer — enter n to see n! and understand its use in permutations and combinations, updated live, as you type.
On this page10 sections
n! = n × (n−1) × … × 2 × 1. 0! = 1. Overflows to ∞ for n > 170.
Results are estimates. Consult a professional.
How the factorial calculator works
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 up to n. Factorials grow extremely fast and are the foundation of combinatorics — counting permutations, combinations, and probability arrangements.
The convention 0! = 1 is not arbitrary — it ensures that combinatorial formulas like C(n, 0) = 1 work consistently. Stirling's approximation is useful for mental estimates when n is large but exact computation is unnecessary.
NIST Digital Library of Mathematical Functions — §5.2 Gamma FunctionWorked example: 5! and 10!
How many ways can you arrange 5 books on a shelf? And how large does 10! get?
Factorials from 0! to 12!
The table below lists exact factorial values up to 12!, which is the largest factorial that fits in a standard 32-bit integer.
| n | n! | Approximate |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 6 | 6 |
| 4 | 24 | 24 |
| 5 | 120 | 120 |
| 6 | 720 | 720 |
| 7 | 5,040 | 5.04 × 10³ |
| 8 | 40,320 | 4.03 × 10⁴ |
| 9 | 362,880 | 3.63 × 10⁵ |
| 10 | 3,628,800 | 3.63 × 10⁶ |
| 11 | 39,916,800 | 3.99 × 10⁷ |
| 12 | 479,001,600 | 4.79 × 10⁸ |
12! = 479,001,600 — the largest factorial below 2³² (≈ 4.29 × 10⁹). 13! exceeds 32-bit integer range.
Tips for working with factorials
Factorials appear most often in combinatorics and probability. These tips prevent common errors.
- Remember 0! = 1 — this is defined, not calculated; it ensures formulas like C(n, 0) = n!/(0! × n!) = 1 are consistent.
- Factorials only apply to non-negative integers — n! is not defined for negative integers or fractions (though the Gamma function extends factorials to real numbers).
- Cancel common factors before multiplying — in C(10, 3) = 10!/(3! × 7!), cancel the 7! from numerator and denominator to get (10×9×8)/(3×2×1) = 120 without computing huge numbers.
- Use logarithms for large factorials — log(n!) = Σ log(k) for k = 1 to n; this avoids overflow and is how calculators handle 100! and beyond.
- Permutations vs combinations — P(n, r) = n!/(n−r)! counts ordered arrangements; C(n, r) = n!/(r!(n−r)!) counts unordered selections.
Accuracy and limitations
This calculator returns exact integer results for n ≤ 18 (the range that fits in a 64-bit integer). For n from 19 to approximately 170, results use double-precision floating-point and are accurate to about 15 significant digits — the trailing digits of very large factorials may be rounded. Beyond 170!, the result exceeds the maximum double-precision value (~1.8 × 10³⁰⁸) and the calculator returns the result in logarithmic form (log₁₀(n!)) to prevent overflow.
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.