Factorial Calculator

Quick answer

A factorial calculator multiplies a whole number by every whole number below it down to 1. It is written with an exclamation mark, so 5 factorial is 5 times 4 times 3 times 2 times 1, which is 120. Zero factorial is defined as 1.

Updated 2026-09-09By Shakeel MuzaffarReviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Combinatorics
A whole number from 0 upward. Large values give very long results.
n! (factorial)
--
Number of digits--
Trailing zeros--

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How to Use the Factorial Calculator

  1. Enter a whole number from 0 upward.
  2. Read the factorial, the product of every whole number down to 1.
  3. See how many digits the result has.
  4. See the number of trailing zeros at the end.

Here is what each result means:

ResultWhat it means
n! (factorial)The product of every whole number from n down to 1.
Number of digitsHow long the result is, useful once it is huge.
Trailing zerosHow many zeros end the number.

What Is a Factorial?

A factorial is the product of a whole number and every whole number below it down to 1, written with an exclamation mark. So 5! = 5 x 4 x 3 x 2 x 1 = 120. By definition 0! = 1, which keeps the counting rules consistent.

Factorials count the number of ways to arrange things. There are n! orders for n distinct items, which is why factorials sit at the heart of permutations, combinations and probability. They grow astonishingly fast: 10 factorial already passes three million, and 100 factorial has 158 digits.

How Does the Factorial Calculator Work?

It multiplies from 2 up to n, keeping every digit exact with big-integer arithmetic.

Definition: n! = n x (n-1) x ... x 2 x 1 and 0! = 1
  1. Start from 1 and multiply by each whole number up to n.
  2. Keep full precision so even huge results stay exact.
  3. Count the digits, and the trailing zeros from factors of 5.

Factorials appear in counting problems; for breaking numbers into primes instead, use the prime factorization calculator.

Factorial Example

Work out 5! and 6!.

Calculation: 5! = 120, and since 6! = 6 x 5!, it is 6 x 120 = 720. Each step just multiplies the previous factorial by the next number, which is why factorials climb so quickly.

How Fast Factorials Grow

Factorials rise faster than powers, which is why large ones need big-integer maths.

nn!
5120
103,628,800
136,227,020,800
20about 2.4 x 10^18

By 20 factorial the result already exceeds what a standard number type can hold exactly, so this tool uses big integers.

Factorials vs Permutations and Combinations

Factorials are the building block of counting formulas.

CountFormulaMeaning
Arrangements of n itemsn!Every order of all items
Permutations of r from nn! / (n - r)!Ordered selections
Combinations of r from nn! / (r! (n - r)!)Unordered selections

Each of these divides one factorial by others, so a factorial tool is the first step in many probability problems.

What Affects the Size of a Factorial

The Value of N

Each step up multiplies by a larger number, so the result grows faster and faster as n rises.

Trailing Zeros

Every factor of 5 paired with a 2 adds a trailing zero, so the count of zeros grows with n in steps.

Digit Length

The number of digits climbs steadily, reaching 158 digits at 100 factorial and far more beyond.

When to Use a Factorial Calculator

Probability and Counting

Find arrangements, or the pieces of a permutation or combination formula.

Algebra and Series

Evaluate factorials that appear in binomial expansions and power series.

Checking Huge Results

Get the exact value, digit count and trailing zeros for a large factorial.

Common Mistakes

1. Thinking 0 Factorial Is 0

By definition, 0 factorial is 1, not 0. This keeps counting formulas working.

2. Taking a Factorial of a Decimal

The plain factorial is defined only for whole numbers. Decimals need the gamma function instead.

3. Expecting a Negative Factorial

Factorials are not defined for negative numbers in ordinary maths.

4. Underestimating the Growth

Factorials explode. Even 20 factorial is over two quintillion, so results get long fast.

5. Losing Precision

A standard number type rounds large factorials. Exact answers need big-integer arithmetic, which this tool uses.

Accuracy and Limitations

The result is exact for whole numbers in range; only display length is trimmed for very long values.

What it calculates accurately

  • Exact factorials of whole numbers
  • The number of digits
  • The count of trailing zeros

What it does not do

  • Factorials of decimals or negatives
  • The gamma function for non-integers
  • Values above the input cap
  • Permutation or combination counts directly

How We Compute Your Factorial

Method
Multiply from 1 up to n with big-integer arithmetic, then count digits and trailing zeros.
Inputs used
A single whole number n.
Assumptions
A non-negative whole number; zero factorial is one.
Rounding
None; results are exact whole numbers.
Edge cases
0 and 1 both give 1; values above 5000 are declined for speed.
Sources
See Sources below.
Last reviewed
2026-09-08.

Frequently Asked Questions

What is a factorial?

A factorial is the product of a whole number and every whole number below it down to 1. It is written with an exclamation mark, so 5 factorial is 5 times 4 times 3 times 2 times 1, which is 120.

What is 0 factorial?

Zero factorial is defined as 1. It may seem odd, but it keeps counting formulas consistent, since there is exactly one way to arrange nothing.

How do you calculate a factorial?

Multiply the number by every whole number below it down to 1. For 6 factorial, that is 6 times 5 times 4 times 3 times 2 times 1, which is 720. This tool does it exactly for any whole number.

Can you take a factorial of a decimal?

Not the ordinary factorial, which is defined only for whole numbers. The gamma function extends the idea to decimals and negatives, but that is a separate calculation.

Why do factorials have trailing zeros?

Each trailing zero comes from a factor of 10, which is a 2 times a 5. Fives are rarer than twos, so the number of trailing zeros equals the count of factors of 5 in the product.

How many digits does 100 factorial have?

100 factorial has 158 digits. Factorials grow extremely fast, so even modest inputs produce very long numbers, which is why this tool uses exact big-integer arithmetic.

What are factorials used for?

They count arrangements and underpin permutations, combinations and probability. They also appear in algebra, in binomial expansions and in the power series of many functions.

How big a number can this handle?

It computes exact factorials for whole numbers up to 5000. The full result can have thousands of digits, so above a length the display is shortened while the digit count stays exact.

Is my information saved?

No. The calculation runs in your browser and nothing you enter is stored or sent anywhere, unless you choose Save, which keeps the result only on this device.

Sources

Related Calculators

Looking for more math tools?

Explore all math calculators

This calculator finds the exact factorial of a whole number, using big-integer arithmetic so even large results are exact. Very large factorials have thousands of digits, so the full number is shortened for display above a point. Spotted an error? Let us know.

Creator

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.