Factorial (n!) Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Factorial calculator: what it computes

The factorial of a non‑negative integer n, written n!, is the product of all whole numbers from 1 up to n. This page computes exact factorial values in your browser using BigInt, so results are not rounded (within practical performance limits).

Quick definition

For integers n ≥ 1:

n! = n × (n − 1) × (n − 2) × … × 2 × 1

And by convention:

0! = 1 (the “empty product”).

MathML (product form)

n!= k=1 n k

Recursive form (useful for reasoning)

Factorials satisfy:

n! = n × (n − 1)!, with 0! = 1.

How to use this calculator

  1. Enter a whole number n ≥ 0.
  2. Select Compute Factorial (or press Enter).
  3. Review the outputs: the exact value of n! and the number of digits.
  4. Use Copy Result to copy the factorial value to your clipboard.

This tool is intentionally limited to standard factorials for non‑negative integers. If you need “factorials” of decimals or negative numbers, that’s typically the Gamma function, which is not computed here.

How to interpret the result

Factorials grow extremely fast. Even modest inputs produce very large integers:

That rapid growth is exactly why factorials appear in counting and probability problems: they count how many ways to arrange or choose items.

Worked example

Suppose you want to compute 6!.

By the definition:

6! = 6 × 5 × 4 × 3 × 2 × 1 = 720

Interpretation: if you have 6 distinct objects (for example, 6 different books), there are 720 different possible orderings.

Common factorial values (and digit counts)

This table is helpful for sanity‑checking results and understanding growth.

n n! Digits in n! Notes
0 1 1 Defined as the empty product
1 1 1 Same value as 0!
5 120 3 Small counting problems
10 3,628,800 7 Already in the millions
20 2,432,902,008,176,640,000 19 Exceeds 64‑bit integer range
50 30,414,093,201,713,378,043,612,608,166,064,768,844,377,641,568,960,512,000,000,000,000 65 Large but still commonly referenced
100 93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621,468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253,697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000 158 Often used in examples; huge integer

Why factorials matter (common uses)

Permutations (arrangements)

If you have n distinct items and want to count how many different orderings exist, the answer is n!.

Combinations (choosing without order)

The number of ways to choose r items from n items is:

C(n, r) = n! / (r!(n − r)!)

That’s why factorials show up constantly in probability, statistics, and counting problems.

Series expansions (why n! appears in calculus)

Factorials appear in power series; for example, the exponential function can be written as:

ex = Σ (xn / n!) for n = 0 to .

Limitations and assumptions (important)

FAQ

What is 0! and why is it 1?

0! = 1 by convention (the empty product). This makes many formulas—especially in combinations and series expansions—work consistently.

Why do factorials grow so fast?

Each step multiplies by a larger integer (e.g., n! includes a factor of n), so growth accelerates quickly. That’s why digit counts rise rapidly as n increases.

Can you compute factorials for decimals?

Not with this tool. The continuous extension of factorial is the Gamma function, defined for many non‑integer values. This calculator intentionally restricts inputs to integers for exact results.

What is the largest n I can compute?

It depends on your device and browser, but this page sets a maximum to remain responsive. Even before the cap, copying and rendering can be the limiting factor because the result can contain thousands of digits.

Enter a whole number ≥ 0. For responsiveness, this calculator limits n to 5,000.

Enter a value to see n!

Embed this calculator

Copy and paste the HTML below to add the Factorial Calculator (n!) — Exact BigInt Results & Digit Count to your website.