Calculate the factorial (n!) of any non-negative integer with exact big-number precision.
📖 Factorial Definition with Arbitrary-Precision Arithmetic (BigInt)Fill in the fields on the left with your information, then press Calculate to see your result instantly. No sign-up required, and no data is sent anywhere — everything is calculated right in your browser.
The factorial (n!) calculator calculates the product of all positive integers from 1 to n, a fundamental operation in combinations, permutations, and event probabilities. For example, 5! = 5×4×3×2×1 = 120. Zero factorial (0!) is specially defined to equal 1, a mathematical convention that makes combination and permutation equations work correctly without exceptional cases. Factorials grow extremely quickly (10! is only 3,628,800, but 20! is greater than 2.4 quintillion), which is why this calculator uses JavaScript's BigInt data type to maintain full precision with no rounding even for very huge numbers. Factorials are widely used in calculating the number of possible ways to arrange a set of items, and in combination (nCr) and permutation (nPr) equations. This explosive growth rate is itself a well-known example in mathematics of how quickly a simple repeated-multiplication process can outpace intuition, since each additional term multiplies the running total by an ever-larger number rather than adding a fixed amount.
Factorial growth is one of the more genuinely startling patterns in elementary mathematics: 5! is a modest 120, but 15! already exceeds one trillion, and 20! is greater than 2.4 quintillion — a number so large it has little everyday intuitive meaning. Understanding why factorials explode so quickly, and why this matters practically, starts with recognizing exactly what a factorial represents.
n! counts the number of distinct ways to arrange n different items in a row. With 1 item, there is obviously only 1 arrangement. With 2 items, there are 2 arrangements (swap them or don't). With 3 items, there are 6 arrangements, because each of the 3 choices for the first position leaves 2 remaining choices for the second, and only 1 for the third. Every additional item multiplies the total number of arrangements by the new, larger count of items — not by a fixed amount — which is exactly the mathematical mechanism behind factorial numbers growing so much faster than familiar exponential growth, let alone simple linear growth.
The special definition 0! = 1 can seem arbitrary at first, but it exists specifically so that formulas built on factorials — particularly the combination and permutation formulas — continue to work correctly in the edge case of choosing zero items or arranging zero items. There is, after all, exactly one way to arrange an empty set of items: do nothing, a single valid 'arrangement', which is consistent with defining 0! as 1 rather than 0.
Because factorials grow so explosively, they routinely exceed the range where standard numeric data types in most programming languages (including ordinary JavaScript numbers) remain fully precise — which is exactly why a calculator built to handle large factorials accurately needs arbitrary-precision arithmetic (BigInt) rather than standard floating-point numbers, to avoid silently returning a rounded, slightly incorrect answer for larger values of n.
Factorials are the essential building block behind permutations and combinations, probability calculations involving arrangements (the classic 'how many ways can a deck of cards be shuffled' question, whose answer, 52!, is a number with 68 digits), and specific mathematical series used in calculus, including the series expansions used to approximate functions like eˣ and sine to high precision.
It's a mathematical convention that keeps combinatorics formulas (like permutations and combinations) working correctly without special exceptions for zero.
Factorials grow extremely fast — 1000! already has over 2,500 digits — so this cap keeps the result readable and calculation fast in the browser.
It uses JavaScript's BigInt data type, which performs exact integer arithmetic with no rounding, unlike regular floating-point numbers.