Large Factorial Calculator
Calculate the factorial of large numbers (n!) with arbitrary precision using BigInt, with no lost digits. Ideal for combinatorics and probability.
n!
—
Factorial of large n
The factorial n! is the product 1 · 2 · 3 · ... · n. By convention 0! = 1, which lines up with the gamma function Γ(1) = 1. Growth is brutal. 10! = 3.628.800, 20! ≈ 2.43·10¹⁸, and 21! already overflows a 64-bit unsigned integer (2⁶⁴ ≈ 1.84·10¹⁹). Once you pass that you have to reach for arbitrary-precision integers: JavaScript's BigInt (ES2020+), Python's native int, Java's BigInteger, or a dedicated library. To give you a sense of scale, 100! ≈ 9,33·10¹⁵⁷ runs to 158 digits. When you only want a ballpark figure, Stirling's approximation is quick: n! ≈ √(2πn) · (n/e)ⁿ. The factorial also extends to real and complex numbers via the gamma function, where Γ(n+1) = n! for non-negative integers.
Applications
Factorials show up all over the place: in combinatorics (permutations of n objects), in probability (the binomial and Poisson distributions), in the Taylor series eˣ = Σ xⁿ/n!, in RSA and other corners of number theory, and in countless counting problems across computer science.
FAQ
Why is 0! = 1? Because it's the empty product, the product when there are no factors at all. Defining it that way keeps formulas like C(n,0) = n!/(0!·n!) = 1 working without special cases, and it agrees with Γ(1) = 1.
What is the maximum n in regular JavaScript? A Number (double precision) holds up to 170!; 171! tips over into Infinity. Switch to BigInt and the only ceiling is how much memory and time you're willing to spend.
Can we compute n! for non-integer n? Yes, the gamma function handles it, since n! = Γ(n+1). To take one case, (1/2)! = √π/2 ≈ 0,8862.
Related Tools
Big Factorial (BigInt)
Compute n! up to 1000 with BigInt and show full result + digit count.
Great Wall Workers Calculator
Estimates how many workers were needed to build the Great Wall of China from total structure volume and average rate per worker year.
Factorial Calculator
Compute n! (factorial) for any integer up to 170 (double precision limit). Above that, returns exact BigInt. Useful for combinatorics, probability and discrete math. Everything in your browser.
Combinations & Permutations
Calculate combinations C(n,k) and permutations P(n,k) with formulas and results for large numbers. Essential for combinatorics.
Pilotage Time Large Port Brazil
Estimates average pilotage time at large Brazilian ports such as Santos and Itaqui.
Great Wall Build Years Calculator
Computes total Great Wall of China construction time from length in km and average meters of wall raised per year by workers.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.