Factorial Calculator (n!) with Reference Table
Calculate n! instantly. Enter any non-negative integer and get the exact factorial value with a reference table from 0! to 20!, worked examples for permutations and combinations, and Stirling's approximation.
- Data verified · June 2026
- Edited by Martín Rodríguez
- Formula verified by automated tests
- Private — runs on your device
See step-by-step calculation
See this calculation step by step
See period-by-period detail
How to use this calculator
Follow this tool’s steps, then review its formula, assumptions, and limits below.
When to use this calculator
- Counting the number of ways to arrange 8 competitors on a podium: 8! = 40,320 possible orderings.
- Calculating permutations of a 13-card hand dealt from a shuffled deck using 52! / 39!.
- Computing binomial coefficients C(n, k) = n! / (k! × (n−k)!) needed for probability distributions and statistical tests.
- Determining the number of unique routes a delivery driver can take visiting 10 stops: (10−1)! = 362,880 circular permutations.
- Evaluating Taylor/Maclaurin series terms such as e^x = Σ (x^n / n!) in calculus and physics simulations.
- Checking hash collision probabilities using the birthday problem approximation involving k! terms.
Factorial Values: n! from 0 to 20
| n | n! | Scientific Notation | Number of Digits |
|---|---|---|---|
| 0 | 1 | 1 × 10⁰ | 1 |
| 1 | 1 | 1 × 10⁰ | 1 |
| 2 | 2 | 2 × 10⁰ | 1 |
| 3 | 6 | 6 × 10⁰ | 1 |
| 4 | 24 | 2.4 × 10¹ | 2 |
| 5 | 120 | 1.2 × 10² | 3 |
| 6 | 720 | 7.2 × 10² | 3 |
| 7 | 5,040 | 5.04 × 10³ | 4 |
| 8 | 40,320 | 4.032 × 10⁴ | 5 |
| 9 | 362,880 | 3.629 × 10⁵ | 6 |
| 10 | 3,628,800 | 3.629 × 10⁶ | 7 |
| 11 | 39,916,800 | 3.992 × 10⁷ | 8 |
| 12 | 479,001,600 | 4.79 × 10⁸ | 9 |
| 13 | 6,227,020,800 | 6.227 × 10⁹ | 10 |
| 14 | 87,178,291,200 | 8.718 × 10¹⁰ | 11 |
| 15 | 1,307,674,368,000 | 1.308 × 10¹² | 13 |
| 16 | 20,922,789,888,000 | 2.092 × 10¹³ | 14 |
| 17 | 355,687,428,096,000 | 3.557 × 10¹⁴ | 15 |
| 18 | 6,402,373,705,728,000 | 6.402 × 10¹⁵ | 16 |
| 19 | 121,645,100,408,832,000 | 1.216 × 10¹⁷ | 18 |
| 20 | 2,432,902,008,176,640,000 | 2.433 × 10¹⁸ | 19 |
Fuente: NIST Digital Library of Mathematical Functions §5.1–5.2 (dlmf.nist.gov/5)
How it works
How It Is Calculated
The factorial function is defined both recursively and iteratively:
Iterative: n! = 1 × 2 × 3 × … × n
Recursive: n! = n × (n−1)! (base case: 0! = 1)
Stirling's Approximation (large n):
n! ≈ √(2πn) × (n/e)^n
where e ≈ 2.71828The convention 0! = 1 ensures combinatorial formulas remain consistent when k = 0 or k = n.
---
Reference Table: Factorial Values 0 to 20
---
Large Factorial Quick Reference
| n | n! (approx.) | Digits |
|---|---|---|
| 25 | 1.551 × 10²⁵ | 26 |
| 50 | 3.041 × 10⁶⁴ | 65 |
| 100 | 9.333 × 10¹⁵⁷ | 158 |
| 170 | 7.257 × 10³⁰⁶ | 307 |
| 171 | overflow | exceeds double-precision floating point |
> Number of digits in n! ≈ n·log₁₀(n/e) + ½·log₁₀(2πn) — for n = 1,000 that is 2,568 digits.
---
Worked Examples
Permutations — arranging a playlist of 7 songs in every possible order:
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040 unique orderings.
Combinations — choosing a 5-person committee from 10 candidates:
C(10, 5) = 10! / (5! × 5!) = 3,628,800 / (120 × 120) = 252 distinct committees.
Probability — how unique is a shuffled deck of 52 cards?
Total distinct orderings: 52! ≈ 8.066 × 10⁶⁷ — essentially every fair shuffle in history is a unique event.
Taylor series — computing e¹:
e¹ = 1/0! + 1/1! + 1/2! + 1/3! + … = 1 + 1 + 0.5 + 0.1667 + … ≈ 2.71828
---
Common Mistakes
1. Assuming 0! = 0. The factorial of zero is 1 — required for consistent combinatorial formulas.
2. Applying factorials to negative integers. n! is undefined for negative integers in the standard definition.
3. Applying factorials to non-integers. 3.5! requires the Gamma function: Γ(4.5) ≈ 11.632.
4. Integer overflow in code. C (32-bit int) overflows at 13!. Use 64-bit integers up to 20!, or arbitrary-precision for larger values.
5. Confusing n! with n^n. 5! = 120 but 5^5 = 3,125.
---
Related Calculators
Example: 6!
Frequently asked questions
Why does 0! equal 1 and not 0?
What are the factorial values from 1 to 10?
What is the largest factorial a standard calculator can compute exactly?
How fast do factorials grow compared to exponential functions?
What is Stirling's approximation and when should I use it?
Can I compute the factorial of a decimal like 2.5!?
math.gamma(3.5), in R as gamma(3.5), and in Wolfram Alpha.How many digits does 100! have?
How many trailing zeros does n! have?
What real-world applications use factorials?
Sources & references
Methodology & trust
Math calculator with its formula verified automatically against NIST Digital Library of Mathematical Functions — Gamma Function and Factorials (§5.1–5.2), per our editorial policy and methodology.
Updated: June 2026. Parameters are verified periodically against the cited sources.
Calculations run 100% in your browser. We do not store or transmit your data.
Indicative results. For critical decisions, consult a professional.
📌 How to cite this calculator
Rodríguez, M. (2026). Factorial Calculator (n!) with Reference Table. Hacé Cuentas. https://hacecuentas.com/en/factorial-numero-n
@misc{hacecuentas_factorial_numero_n_2026,
author = {Rodríguez, Martín},
title = {{Factorial Calculator (n!) with Reference Table}},
year = {2026},
howpublished = {\url{https://hacecuentas.com/en/factorial-numero-n}},
note = {Hacé Cuentas}
} Content licensed under CC-BY 4.0 — reuse it citing the source with a link to Hacé Cuentas.