Factorial Calculator

Calculate n factorial exactly for any whole number from 0 through 170.

Calculate a factorial
Enter a nonnegative integer to multiply every whole number from n down to 1.

About factorials

The factorial of a nonnegative integer n is the product of every positive integer from n down to 1. It is written n!, so 5! means 5 times 4 times 3 times 2 times 1, which equals 120. Factorials grow extraordinarily quickly because each new value multiplies the previous result by another increasing integer. Even 20! is already greater than two quintillion. Two base cases are especially important. The value 1! is 1, and mathematics defines 0! as 1. The zero case may initially seem surprising, but it preserves the recursive identity n! = n times (n - 1)! and makes counting formulas behave consistently. There is exactly one way to arrange zero objects or choose zero objects from a collection, so the associated count must be one. Factorials are central to combinatorics. There are n! possible orders for n distinct objects. If eight different books are placed on a shelf, 8!, or 40,320, arrangements are possible. Combinations and permutations use ratios of factorials to count selections when order does or does not matter. Probability formulas rely on those counts to determine the likelihood of card hands, lottery selections, schedules, and experimental outcomes. The function also appears in algebra, calculus, statistics, and computer science. Taylor series use factorial denominators to represent functions such as exponential, sine, and cosine. The Poisson and binomial probability distributions contain factorial terms. Algorithm analysis uses factorial time to describe procedures that explore every possible ordering, a growth rate that becomes impractical even for modest input sizes. This calculator uses integer arithmetic rather than floating-point multiplication, so every displayed digit is exact throughout the supported range. The upper input limit of 170 follows the legacy tool's practical boundary and keeps output manageable, although integer arithmetic itself can represent larger results. Factorials are defined here only for whole numbers. The gamma function extends the idea to many non-integer and complex values, but that is a different operation and is not evaluated by this tool. For rough estimates of very large factorials, Stirling's approximation relates n! to the expression square root of 2 pi n times (n divided by e)^n. The approximation improves as n increases, but an exact calculator remains preferable whenever the full integer is required. Use the displayed answer for counting problems, formula checks, classroom exercises, and comparisons of how rapidly factorial growth overtakes ordinary exponential growth.

Factorial examples

See the special zero case and how quickly products grow.

ExpressionExact valueExplanation
0!1The empty-product convention.
5!1205 times 4 times 3 times 2 times 1.
10!3,628,800The number of arrangements of ten distinct objects.
15!1,307,674,368,000An example of rapid factorial growth.

How to use the factorial calculator

  1. Enter a nonnegative whole number from 0 through 170.
  2. Select Calculate Factorial to multiply the integer sequence exactly.
  3. Read the complete result, including grouping separators for large values.
  4. Change the input and calculate again to compare factorial growth.

Factorial calculator FAQ

Why does zero factorial equal one?

The value 0! is defined as 1 so recursive and combinatorial formulas remain consistent. It also represents the one possible arrangement of an empty collection.

What is the recursive factorial formula?

For a positive integer n, the identity is n! = n times (n - 1)!. The recursion stops at 0! = 1.

Are decimal factorials allowed?

This calculator evaluates the standard factorial only for nonnegative integers. The gamma function can extend related calculations to many non-integer values.

Why do factorials grow so quickly?

Each successive factorial multiplies the previous value by a larger integer. This eventually outpaces any exponential function with a fixed base.

Where are factorials used?

Factorials count permutations and appear in combinations, probability distributions, and series expansions. They also describe the complexity of algorithms that test every ordering.