Factorial Calculator

Calculate factorial (n!) for any non-negative integer. See exact values, number of digits, and related factorials.

Enter a non-negative integer (0-170)

Factorial: n! = n * (n-1) * (n-2) * ... * 2 * 1\n\nSpecial Cases:\n0! = 1 (by definition)\n1! = 1\n\nDouble Factorial:\nn!! = n * (n-2) * (n-4) * ... * 2 or 1\n\nStirling's Approximation:\nn! ≈ sqrt(2PIn) * (n/e)ⁿ
Example 1:\n5! = 5 * 4 * 3 * 2 * 1 = 120\n\nExample 2:\n10! = 10 * 9 * 8 * ... * 1 = 3,628,800\n\nExample 3:\n0! = 1 (by definition)\n\nExample 4:\n20! = 2.432902008176640000 * 10^1⁸\n\nApplications:\n- 5! = 120 ways to arrange 5 items\n- 8!! = 8*6*4*2 = 384 (double factorial)

What is a factorial?

Factorial of n (written n!) is the product of all positive integers from 1 to n. Example: 5! = 5 * 4 * 3 * 2 * 1 = 120. Special case: 0! = 1 by definition. Used in permutations, combinations, probability, and series.

How do you calculate large factorials?

Large factorials grow extremely fast. 10! = 3,628,800. 20! = 2.4 * 10^1⁸. 100! has 158 digits! Use programming for large factorials. Stirling's approximation estimates: n! ≈ sqrt(2PIn) * (n/e)ⁿ. Most calculators limit to ~170! due to overflow.

What are factorials used for?

Permutations: number of ways to arrange n items = n!. Combinations: C(n,r) = n! / (r!(n-r)!). Probability calculations, Taylor series expansions, binomial coefficients, counting problems, statistics, and mathematical proofs.

What is the difference between factorial and double factorial?

Regular factorial (n!): multiply all integers from 1 to n. Double factorial (n!!): multiply every other integer. 8!! = 8*6*4*2 = 384. 7!! = 7*5*3*1 = 105. Used in some physics and combinatorics formulas.

Can you take factorial of negative numbers or decimals?

Negative factorials are undefined. Factorial extends to non-integers via the Gamma function: Γ(n) = (n-1)! for positive integers. For non-integers: Γ(n) = ∫₀^∞ t^(n-1)e^(-t)dt. Example: (1/2)! = Γ(3/2) = sqrtPI/2 ≈ 0.886.