Factorial Calculator

Factorials count the ways to arrange n distinct items, and they grow extremely fast: ten factorial is already 3,628,800, and 20! is over two quintillion. Ten factorial has 2 trailing zeros because there are two factors of 5 in the product. Factorials appear in permutations and combinations, in probability and in series expansions.

Use the result to see how quickly the number of arrangements explodes.

Factorial Calculator: inputs

Calculated result
n factorial3,628,800
Trailing zeros2

Factorial Calculator: Whole number n sensitivity

Factorial Calculator: Whole number n and n factorial5 calculations vary the “Whole number n” input while holding the other entered inputs constant.840,3209362,880103,628,8001139,916,80012479,001,600

Factorial: worked example

Whole number n10
n factorial3,628,800
Trailing zeros2

Factorial: formula

n! = n × (n−1) × … × 2 × 1; trailing zeros = ⌊n÷5⌋ + ⌊n÷25⌋ + ⌊n÷125⌋ + …

Factorial: Wolfram MathWorld

Enter a non-negative whole number n up to 170. The factorial n! is the product of all positive integers up to n, and zero factorial is defined as 1. Larger values exceed what standard floating-point numbers can hold.

The calculator also counts trailing zeros, using the formula that sums n divided by 5, 25, 125 and so on. Decimals and negatives do not have ordinary factorials.

Factorial: changing Whole number n

Whole number nn factorialTrailing zeros
840,3201
9362,8801
10 (example)3,628,8002
1139,916,8002
12479,001,6002

Factorial: compare input ranges

InputTested fromTon factorial: low inputn factorial: high inputSwing
Whole number n911362,88039,916,80039,553,920 (1090%)

Factorial: individual input comparisons

InputValuen factorialTrailing zeros
Whole number n840,3201
9362,8801
103,628,8002
1139,916,8002
12479,001,6002

Factorial: which assumptions move the result?

Factorial: n factorial as Whole number n changesn factorial starts at 40,320. Moving Whole number n from 8 to 12 changes it to 479,001,600, with the displayed formula kept fixed.840,3209362,880103,628,8001139,916,80012479,001,600
Chart quantityDisplayed settings
Whole number n8 → 12
n factorial40,320 → 479,001,600

Factorial: values and definitions

Quantity and definitionValue used
Whole number n — A whole number from 0 to 170. Beyond 170 the answer no longer fits in a computer's number format.10
n factorial3,628,800
Trailing zeros2

Factorial: half and double Whole number n

Whole number nn factorial
5120
103,628,800
202,432,902,008,176,640,000

Common error: Using n factorial when order does not matter. Choosing three people from ten as a group is a combination, which divides the factorial down; ten factorial itself counts every seating order.

This output uses floating-point arithmetic. Large integer factorials can lose exact integer precision even before overflow; the supported limit of 170 keeps the magnitude finite. Exact combinatorial work can require integer arithmetic.

The separate trailing-zero count does not depend on displaying every factorial digit.

Number Theory & Precision calculators: Modulo Calculator, Fibonacci Calculator, Prime Number Calculator, GCF & LCM Calculator, Prime Factorization Calculator, Scientific Notation Calculator.

Factorials outrun intuition fast. Ten factorial is 3,628,800. Twenty is past two quintillion.

The number counts the ways to order a set of items, so it tells you when listing every arrangement stops being an option and a formula or a sample is the only route. The trailing-zero count is a quick way to see how many times the product picks up a factor of ten.

Confirm the item count is whole and small enough. Above 170 the true answer exceeds what a computer number can hold, so the page stops there.

Count arrangements on the permutation and combination calculator, and chances on the probability and binomial pages. The scientific notation calculator helps read large results, and the exponent page shows how fast powers grow compared with factorials. The Fibonacci page covers another growing sequence.

Factorial Calculator: quantities and terminology

How many trailing zeros does a factorial have?

One for each factor of 10, and since fives are scarcer than twos, count the factors of 5: divide n by 5, 25, 125 and add the whole parts.

What is a factorial?

The product of all positive whole numbers up to n. For example 5 factorial is 5 times 4 times 3 times 2 times 1, or 120.

Why is 0 factorial equal to 1?

By convention, because there is exactly one way to arrange zero items, and it keeps formulas for combinations consistent.