Factorial Calculator
Calculate n! exactly for any integer up to 10,000 using BigInt — nothing is uploaded.
How factorial calculation works
The factorial of a non-negative integer n, written n!, is the product of every positive integer from 1 up to n. By convention, 0! equals 1. Factorials grow extremely fast: 10! is 3,628,800 but 100! has 158 digits. Standard 64-bit floating-point arithmetic loses precision around 18!, so this tool uses JavaScript's built-in BigInt type to compute exact integer results for any n up to 10,000. The exact digit count is shown alongside the result so you can gauge the size at a glance.
Factorials appear throughout combinatorics (counting permutations and combinations), probability, and analysis (the Taylor series for e^x involves 1/n!). All computation runs locally in your browser — no data is transmitted.
FAQ
Why is 0! equal to 1? The empty product is defined as 1 by convention, which makes combinatorial formulas consistent. For instance, there is exactly one way to arrange zero items, which is the empty arrangement.
What is the largest n supported? The tool accepts n up to 10,000. 10000! has 35,659 digits and takes under a second to compute in modern browsers using BigInt.
Why does the tool reject decimals? The factorial function is only defined for non-negative integers in the classical sense. Extension to real numbers (via the Gamma function) is outside the scope of this tool.
What about negative numbers? Factorial is undefined for negative integers, and the tool returns an error message rather than a silent incorrect result.