Free Factorial Calculator
Compute the factorial n! of any non-negative integer exactly — from small values like 5! = 120 up to massive results like 100!, with full digits, scientific form, and a digit count.
Enter a non-negative whole number to compute its factorial n! exactly (uses BigInt, so even very large results are precise).
By definition 0! = 1. Values above 18! exceed the exact range of ordinary floating-point numbers, so this tool uses arbitrary-precision integers to stay correct.
Quick answer
The factorial of a non-negative integer n, written n!, is the product of every integer from 1 up to n, so n! = 1·2·3·…·n. For example, 5! = 1·2·3·4·5 = 120, and by definition 0! = 1. This calculator multiplies the terms using arbitrary-precision integers, so even 100! returns its exact 158-digit value rather than a rounded approximation.
Formula & method
n! = 1 · 2 · 3 · … · n
- n — a non-negative integer (0, 1, 2, 3, …)
- n! — the factorial of n, i.e. the product of all integers from 1 to n
The factorial is the product of all positive integers up to n. The empty product gives the base case 0! = 1.
n! = n · (n − 1)!
Recursive definition: each factorial is n times the previous one, anchored by 0! = 1. This is why factorials grow extremely fast.
Examples
- Input
- n = 5
- Result
- 120
- Why
- Multiply 1·2·3·4·5. Step by step: 1·2 = 2, 2·3 = 6, 6·4 = 24, 24·5 = 120. So 5! = 120.
- Input
- n = 0
- Result
- 1
- Why
- By definition the factorial of zero is 1 (the empty product). This keeps formulas like n! = n·(n−1)! consistent: 1! = 1·0! = 1·1 = 1.
- Input
- n = 10
- Result
- 3,628,800
- Why
- 10! = 1·2·3·4·5·6·7·8·9·10. Building up: 5! = 120, then ×6 = 720, ×7 = 5040, ×8 = 40320, ×9 = 362880, ×10 = 3,628,800.
- Input
- n = 20
- Result
- 2,432,902,008,176,640,000
- Why
- 20! has 19 digits and already exceeds a 32-bit integer. Continuing 10! = 3,628,800 and multiplying by 11 through 20 gives 2,432,902,008,176,640,000 — computed exactly with BigInt, no rounding.
When to use this tool
- Computing permutations and combinations (nPr and nCr), where factorials appear in the numerator and denominator.
- Evaluating probability and statistics formulas — binomial coefficients, Poisson distributions, and arrangement counts all rely on n!.
- Checking terms of a Taylor or Maclaurin series, where each term divides by k! (e.g. eˣ = Σ xᵏ/k!).
- Verifying homework or exam answers and exploring how fast factorials grow (e.g. seeing that 100! has 158 digits).
Common mistakes
- Trying to compute a factorial of a negative number. n! is undefined for negatives — the standard factorial is defined only for non-negative integers (the gamma function extends it, but not to negative integers).
- Expecting a decimal input like 4.5! to work. Ordinary factorials require whole numbers; 4.5! needs the gamma function, Γ(5.5), which this tool does not compute.
- Forgetting that 0! = 1, not 0. The empty product is 1, which is essential for combinations and series formulas.
- Relying on a basic calculator or floating-point math for large factorials. From 19! onward the exact value exceeds the 53-bit precision of standard doubles, so results silently round — this tool uses BigInt to stay exact.
Frequently asked questions
What is a factorial in simple terms?
A factorial n! is what you get when you multiply every whole number from 1 up to n together. For example, 4! = 1·2·3·4 = 24. It counts the number of ways to arrange n distinct items in a row, which is why it shows up constantly in counting and probability.
Why is 0! equal to 1 and not 0?
0! is defined as 1 because it represents the empty product — multiplying no numbers together gives the multiplicative identity, 1. It also makes formulas consistent: there is exactly one way to arrange zero items, and the combination formula nCn = n!/(n!·0!) only equals 1 when 0! = 1.
Can you take the factorial of a negative number or a decimal?
Not with the ordinary factorial. n! is defined only for non-negative integers (0, 1, 2, …). The gamma function Γ(x) extends the idea to non-integers and gives values like Γ(0.5) = √π, but it is still undefined for negative integers. This calculator handles only non-negative integers.
How large a factorial can this calculator handle?
It uses JavaScript BigInt, so results are exact with no rounding even for hundreds of digits. We cap n at 100,000 only to keep your browser responsive; 100! (158 digits) or 1000! return instantly. For comparison, 100! ≈ 9.33 × 10¹⁵⁷.
What is the difference between a factorial and a permutation?
A factorial n! counts arrangements of all n items. A permutation nPr = n!/(n−r)! counts ordered arrangements of just r items chosen from n. So a full permutation of all items, nPn, equals n!. Factorials are the building block for both permutations and combinations.
Why does my phone calculator give a rounded value for 25!?
Most calculators use floating-point (double-precision) numbers, which are exact only up to about 15–16 significant digits. 25! has 26 digits, so the last digits get rounded to zeros (you often see something like 1.551121e+25). This tool computes with exact integers, returning the full 15,511,210,043,330,985,984,000,000.
Sources & references
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
- Permutation and Combination CalculatorCalculators
- LCM & GCD CalculatorCalculators
- Prime Number CheckerCalculators
- Scientific CalculatorScience & Engineering
- Percentage CalculatorCalculators
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the factorial calculator to appear: