ToolJutsu
All tools
Calculator Tools

Factorial Calculator

Calculate factorials, even for very large numbers.

The factorial n! is the product of every whole number from 1 to n. By definition 0! = 1. Results are computed exactly with BigInt.

20! ≈ scientific notation

2.432902 × 10¹⁸

Number of digits

19

Input

20!

Exact result

2,432,902,008,176,640,000

Processed on your device. We never see your files.

How to use Factorial Calculator

What this calculator does

This tool computes the factorial of a non-negative whole number. You enter n and it returns n! — the product of every integer from 1 up to n. Because factorials grow so rapidly, the calculator does three things at once: it shows the full exact result in a scrollable container (it can run to thousands of digits), it reports how many digits that result has, and it gives a compact scientific-notation approximation for a quick sense of scale. Every result can be copied with one click and recalculates live as you type.

Why you might need it

Factorials are everywhere in counting problems. They give the number of ways to order a set of items, which makes them the backbone of permutations and combinations. Probability calculations — lottery odds, card hands, arrangements — lean on factorials directly. They appear in the binomial theorem, in Taylor series such as the expansion of e and sine, and in many statistical formulas. Students checking combinatorics homework, programmers verifying an algorithm, and anyone curious about how fast factorial growth really is all benefit from a calculator that handles the huge numbers involved without rounding.

How to use it

  1. Type a non-negative whole number into the input field. The value is capped at 10,000 to keep the calculation instant.
  2. Read the scientific-notation approximation in the headline card for a quick sense of the magnitude.
  3. Check the digit count to see exactly how large the result is.
  4. Scroll the exact result panel to view every digit, and use the copy buttons to save the full number.

How it’s calculated

The factorial is defined by n! = n × (n−1) × (n−2) × … × 2 × 1, with the base case 0! = 1. The calculator computes this iteratively: it starts with a running product of 1 and multiplies in each integer from 2 up to n. Crucially, the running product is held as a BigInt, JavaScript’s arbitrary-precision integer type, so no digits are ever lost to rounding. Factorial growth is faster than exponential — the number of digits roughly follows Stirling’s approximation, ln(n!) ≈ n ln n − n — which is why 10! has 7 digits but 1000! has 2568. The scientific-notation figure is derived from the exact result by taking its first significant digits as the mantissa and the digit count minus one as the power of ten.

Common pitfalls

The first surprise is usually how quickly factorials explode: 13! already exceeds two billion, and 21! exceeds what an ordinary 64-bit number can hold exactly — which is why BigInt is essential. Another common slip is forgetting that 0! is 1, not 0. Factorials are also defined only for non-negative whole numbers here; the generalisation to fractions and negatives uses the gamma function, which this tool does not cover. Finally, the scientific-notation value is an approximation for readability — the panel labelled “exact result” holds the precise answer.

Tips

To compute a permutation count, remember nPr = n! ÷ (n−r)!, and for combinations nCr = n! ÷ (r! × (n−r)!) — you can calculate each factorial here and divide. The digit count is a handy way to compare magnitudes without reading every digit. Because the whole computation runs locally with exact BigInt arithmetic, you can experiment with large values freely, and nothing you enter ever leaves your browser.

Frequently asked questions

What is a factorial?
The factorial of a non-negative integer n, written n!, is the product of every whole number from 1 up to n. So 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials count the number of ways to arrange n distinct items in order, which is why they appear throughout combinatorics and probability.
Why does 0! equal 1?
By definition 0! is 1. There is exactly one way to arrange an empty set — the empty arrangement — so counting permutations gives 1. The convention also keeps formulas such as the binomial coefficient and the series for e consistent, since they rely on 0! being 1.
How can the tool show factorials with thousands of digits?
It uses JavaScript's BigInt type, which stores whole numbers of unlimited size exactly. Factorials grow extraordinarily fast — 100! already has 158 digits — so an ordinary floating-point number could only approximate them. BigInt lets the calculator display every digit precisely.
Why is n capped at 10,000?
10,000! is a number with over 35,000 digits, and computing much beyond that would make the page slow to respond. The cap of 10,000 keeps every calculation fast and smooth. If you enter a larger value the tool shows a short message instead of freezing.
Is my input sent anywhere?
No. The factorial is computed entirely in your browser with JavaScript. The number you enter is never uploaded, logged, or stored, and the calculator continues to work even if you are offline.

Related tools