← All calculatorsGeneral & Scientific

Factorial Calculator

Computes n! exactly using big-integer arithmetic rather than floating point, so results stay precise well past the point where ordinary calculators give up and return infinity.

n! digits
7
Approximate
3.6288e+6
3628800

How to use the Factorial Calculator

  1. Enter a non-negative whole number.
  2. Read the digit count for an immediate sense of scale.
  3. Scroll the exact value for n up to 500.
  4. Use the order-of-magnitude estimate for larger n.

How the calculation works

n! is the product of every integer from 1 to n, and it counts the number of ways to arrange n distinct items in order. That combinatorial meaning is why it appears throughout probability: permutations, combinations, binomial coefficients and Poisson distributions all contain factorials.

Growth is faster than exponential. 10! is 3.6 million, 20! is 2.4 × 10¹⁸, and 170! is the largest factorial a double-precision float can hold — 171! overflows to infinity. This calculator sidesteps that ceiling with arbitrary-precision integers, so the digits shown are exact rather than rounded.

The digit count comes from summing base-10 logarithms, which is far cheaper than computing the number itself and is the standard way to reason about factorial magnitude. Stirling's approximation, n! ≈ √(2πn)(n/e)ⁿ, gives the same estimate analytically and is the tool of choice in asymptotic analysis.

By convention 0! = 1, since there is exactly one way to arrange nothing — a definition that keeps the combination and permutation formulas valid at their edges.

Formula
n! = n × (n−1) × … × 1 ; 0! = 1 ; Stirling: n! ≈ √(2πn) (n/e)ⁿ

Source: Standard combinatorial definition of the factorial; Stirling's approximation.

Worked example

How many orders can a 52-card deck be shuffled into?

  1. Enter 52.
  2. 52! has 68 digits.
  3. Value ≈ 8.07 × 10⁶⁷.

More orderings than there are atoms in the observable galaxy — any well-shuffled deck is almost certainly unique in history.

Frequently asked questions

Why is 0! equal to 1?+

There is exactly one arrangement of an empty set, and the convention keeps combination formulas consistent.

Can I take the factorial of a decimal?+

Not directly. The gamma function extends factorials to non-integers, with Γ(n+1) = n!.

Why do other calculators fail above 170?+

171! exceeds the maximum double-precision value. Big-integer arithmetic avoids that limit.

Where do factorials show up in practice?+

Permutations and combinations, Taylor series, the Poisson distribution and most counting problems in probability.

Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.

Related

More in General & Scientific