Factorial (n!) Calculator
Factorial calculator: what it computes
The factorial of a non‑negative integer n, written n!, is the product of all whole numbers from 1 up to n. This page computes exact factorial values in your browser using BigInt, so results are not rounded (within practical performance limits).
Quick definition
For integers n ≥ 1:
n! = n × (n − 1) × (n − 2) × … × 2 × 1
And by convention:
0! = 1 (the “empty product”).
Formula: MathML (product form)
Recursive form (useful for reasoning)
Factorials satisfy:
n! = n × (n − 1)!, with 0! = 1.
How to use this calculator
- Enter a whole number n ≥ 0.
- Select Compute Factorial (or press Enter).
- Review the outputs: the exact value of n! and the number of digits.
- Use Copy Result to copy the factorial value to your clipboard.
This tool is intentionally limited to standard factorials for non‑negative integers. If you need “factorials” of decimals or negative numbers, that’s typically the Gamma function, which is not computed here.
Factorials grow extremely fast. Even modest inputs produce very large integers:
- 10! = 3,628,800 (already millions)
- 20! is larger than what fits in a 64‑bit signed integer
- 100! has 158 digits
That rapid growth is exactly why factorials appear in counting and probability problems: they count how many ways to arrange or choose items.
Worked example
Suppose you want to compute 6!.
By the definition:
6! = 6 × 5 × 4 × 3 × 2 × 1 = 720
Interpretation: if you have 6 distinct objects (for example, 6 different books), there are 720 different possible orderings.
Common factorial values (and digit counts)
This table is helpful for sanity‑checking results and understanding growth.
| n | n! | Digits in n! | Notes |
|---|---|---|---|
| 0 | 1 | 1 | Defined as the empty product |
| 1 | 1 | 1 | Same value as 0! |
| 5 | 120 | 3 | Small counting problems |
| 10 | 3,628,800 | 7 | Already in the millions |
| 20 | 2,432,902,008,176,640,000 | 19 | Exceeds 64‑bit integer range |
| 50 | 30,414,093,201,713,378,043,612,608,166,064,768,844,377,641,568,960,512,000,000,000,000 | 65 | Large but still commonly referenced |
| 100 | 93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621,468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253,697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000 | 158 | Often used in examples; huge integer |
Introduction: Why factorials matter (common uses)
Permutations (arrangements)
If you have n distinct items and want to count how many different orderings exist, the answer is n!.
Combinations (choosing without order)
The number of ways to choose r items from n items is:
C(n, r) = n! / (r!(n − r)!)
That’s why factorials show up constantly in probability, statistics, and counting problems.
Series expansions (why n! appears in calculus)
Factorials appear in power series; for example, the exponential function can be written as:
ex = Σ (xn / n!) for n = 0 to ∞.
Limitations and assumptions (important)
- Integer‑only: This calculator accepts whole numbers only. Decimals (e.g., 2.5) and negatives are rejected because standard factorial is defined for integers n ≥ 0.
- Practical performance cap: Very large inputs produce extremely large integers. To keep the page responsive, the calculator enforces a maximum (see the form’s “Max” note). You can lower the input if your device slows down.
- Output can be enormous: Rendering or copying thousands of digits can be slow and may stress older browsers/devices.
- No approximations: The output is exact, not scientific notation. If you only need magnitude (e.g., number of digits), you may prefer approximation methods (e.g., Stirling’s approximation) in a dedicated tool.
- Browser support: Exact computation relies on
BigInt, which is supported by modern browsers. In older environments, this calculator may not work.
FAQ
What is 0! and why is it 1?
0! = 1 by convention (the empty product). This makes many formulas—especially in combinations and series expansions—work consistently.
Why do factorials grow so fast?
Each step multiplies by a larger integer (e.g., n! includes a factor of n), so growth accelerates quickly. That’s why digit counts rise rapidly as n increases.
Can you compute factorials for decimals?
Not with this tool. The continuous extension of factorial is the Gamma function, defined for many non‑integer values. This calculator intentionally restricts inputs to integers for exact results.
What is the largest n I can compute?
It depends on your device and browser, but this page sets a maximum to remain responsive. Even before the cap, copying and rendering can be the limiting factor because the result can contain thousands of digits.
How to interpret the result
Arcade Mini-Game: Factorial (n!) Calculator Calibration Run
Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.
Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.
