Factorial Calculator (n!)

Compute exact factorials of any non-negative integer with BigInt.

Free factorial calculator. Compute n! exactly for any non-negative integer using arbitrary-precision BigInt arithmetic, with the digit count shown. Privacy-first and runs entirely in your browser — nothing is sent anywhere. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is a factorial?

The factorial n! is the product of every whole number from n down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition 0! = 1, and factorials are only defined for non-negative integers.

Factorial calculator

The factorial of a number, written n!, is the product of every whole number from n down to 1. It is one of the most common building blocks in combinatorics — counting permutations, combinations and arrangements — and it appears in probability, calculus (Taylor series) and statistics. This calculator returns the exact value of n! for any non-negative integer, not a rounded approximation, and shows how many digits the answer has.

How it works

The tool multiplies n × (n−1) × (n−2) × … × 2 × 1 using JavaScript’s BigInt type, which supports arbitrary-precision integers. Because ordinary floating-point numbers lose precision above 2^53, BigInt is essential for large factorials — it stores every digit exactly. By definition 0! = 1. To keep the browser responsive the exact path is capped at 5000!, and the digit count is displayed alongside the result.

Reference values

nn!Digits
011
51203
103,628,8007
136,227,020,80010
202,432,902,008,176,640,00019
528.07 × 10⁶⁷68
1009.33 × 10¹⁵⁷158

For n = 10: 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800 (7 digits). This is the number of distinct orderings of 10 items — for example, the number of ways to arrange 10 runners at the start of a race.

Where factorials come up

Permutations — the number of ways to arrange n distinct items in order is n!. If you have 5 books to place on a shelf, there are 5! = 120 possible arrangements.

Combinations (choosing k from n) — the binomial coefficient “n choose k” is n! ÷ (k! × (n−k)!). Factorials appear three times in this formula, which is why a factorial calculator is a natural companion to combination problems.

Probability — many probability calculations involve counting arrangements. For example, the probability that a randomly shuffled deck of 52 cards comes out in a specific order is 1 ÷ 52!, an astronomically small number with 68 digits.

Taylor series in calculus — the expansion of functions like e^x and sin(x) uses factorials in the denominator of each term (e^x = 1 + x/1! + x²/2! + x³/3! + …). The factorial makes the series converge by shrinking each term faster than the powers grow.

Statistics — the Poisson distribution, the binomial distribution, and many combinatorial statistics formulas have factorials in them.

Why BigInt matters for large factorials

A standard JavaScript number (64-bit floating point, IEEE-754) can only represent integers exactly up to 2^53 − 1, which is about 9 quadrillion. Already by n = 18, the factorial exceeds that ceiling, and floating-point would start rounding. The tool uses BigInt, which allocates as many bits as the number needs, storing every digit of even a 16,000-digit result exactly. This is the difference between getting an exact answer and getting a rounded estimate — which matters if you are computing combination counts for cryptographic or statistical purposes.

Everything runs locally in your browser — the number you enter never leaves your device.