Factorial Calculator
Calculate n factorial, double factorial, subfactorial, trailing zeros, and digit count. BigInt support for exact large number results.
Enter a non-negative integer (0 to 10,000).
Enter a number to calculate.
—
Double Factorial (0!!)
0
Subfactorial (!0)
0
Trailing Zeros
0
Digit Count
0
| n | n! | Digits |
|---|
Formulae
n! = 1 × 2 × 3 × ... × n (0! = 1)
n!! = product of every second integer down from n
!n = (n−1)(·!(n−1) + !(n−2)), !0 = 1, !1 = 0
Trailing zeros = Σ floor(n / 5^k) for k = 1, 2, 3, ...
How to use Factorial Calculator
-
Enter a number
Type a non-negative integer into the input field. Decimals are not valid inputs for factorial.
-
View factorial results
See n!, double factorial (n!!), subfactorial (!n), trailing zero count, and digit count instantly.
-
Switch to table mode
Toggle table mode to generate factorials for a range of values side by side.
-
Copy the result
Click the copy button to copy the full factorial value to your clipboard.
-
Explore large values
Try values like 20, 50, or 100 to see exact results using BigInt arithmetic.
Factorial Calculator FAQ
What is a factorial?
How do I calculate a factorial?
What is a double factorial (n!!)?
What is a subfactorial?
How are trailing zeros counted?
What is the largest factorial I can compute?
Why is 0! = 1?
Can I use this for homework?
What is factorial used for?
Is any data sent to a server?
Background
Compute factorials and related functions for any non-negative integer. Enter n to calculate n! (standard factorial), n!! (double factorial, which multiplies every other integer), !n (subfactorial, counting derangements where no element stays in its original position), the number of trailing zeros in n!, and the total digit count of the result. BigInt arithmetic provides exact results even for very large inputs — no floating-point rounding. A table mode generates factorials for a range of values at once, which is useful for quickly comparing growth rates. Trailing zeros in n! are counted using Legendre's formula: sum of floor(n/5^k). Ideal for combinatorics homework, probability problems, and exploring the rapid growth of the factorial function. All processing runs entirely in your browser.
Related tools
Permutation & Combination Calculator
Calculate nPr permutations and nCr combinations with step-by-step formula breakdowns. Supports with and without repetition. BigInt precision.
GCD & LCM Calculator
Find the GCD and LCM of up to 10 numbers at once with step-by-step Euclidean algorithm and prime factorization methods.
Prime Number Tools
Check if a number is prime, find prime factorization, list all primes in a range using the Sieve of Eratosthenes, or find the Nth prime.
Probability Calculator
Calculate single event, compound AND/OR, conditional, and Bayes theorem probabilities with formula display. Results as fractions, decimals, and percentages.
Fibonacci Generator
Generate Fibonacci sequences up to any term, check if a number is Fibonacci, and watch golden ratio convergence. BigInt support.