Factorial Calculator

n!

Number of Digits

Expansion

What Is a Factorial and How Is It Calculated?

A factorial, denoted n!, is the product of all positive integers from 1 to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. By convention, 0! is defined as 1, which maintains consistency in combinatorial formulas. Factorials grow extremely fast -- 10! is already 3,628,800, 20! exceeds 2.4 quintillion, and 170! is the largest factorial that fits in standard floating-point representation. This calculator handles factorials for any non-negative integer and displays the exact result.

Factorials are fundamental to combinatorics, the branch of mathematics dealing with counting and arrangements. The number of ways to arrange n distinct objects in order (permutations) is n!. The binomial coefficient 'n choose k' equals n! / (k! x (n-k)!), which counts the number of ways to select k items from n without regard to order. These formulas underpin probability theory, statistical distributions, and algorithm analysis. The Poisson distribution, binomial distribution, and Taylor series expansions all rely on factorials.

For very large factorials, Stirling's approximation provides a useful estimate: n! is approximately sqrt(2 x pi x n) x (n/e)^n. This approximation becomes increasingly accurate as n grows and is widely used in physics and information theory where exact factorials would be computationally impractical. In programming, factorials are a classic example of both recursive and iterative algorithms, and efficient computation of large factorials requires arbitrary-precision arithmetic libraries since the results quickly exceed standard integer limits.

Frequently Asked Questions

Is this free?

Yes, completely free with no signup required.

How accurate is it?

Uses standard formulas — accurate for estimation. Verify critical decisions with a professional.

Can I share results?

Yes, click Share Result to copy a URL with your inputs.

Works on mobile?

Yes, fully responsive on all devices.

Related Calculators