Factorial Calculator
Calculate n! instantly for any non-negative integer. Free online factorial calculator with BigInt support for arbitrarily large results.
What is a factorial?
The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By mathematical convention, 0! is defined as 1.
How do you calculate a factorial?
To calculate n!, multiply all integers from 1 to n together. For example, 4! = 1 × 2 × 3 × 4 = 24. Alternatively, you can use the recursive definition: n! = n × (n-1)!, with 0! = 1 as the base case.
Why is zero factorial equal to one?
0! = 1 is defined by convention to maintain consistency across mathematics. It ensures formulas like the binomial theorem, permutation formulas, and power series expansions work correctly even when n = 0.
What are factorials used for?
Factorials appear throughout mathematics and science: counting permutations (n! ways to arrange n objects), probability theory, combinatorics, Taylor series expansions, and in formulas for derivatives and integrals in calculus.
Can you calculate the factorial of a negative number?
No, factorials are only defined for non-negative integers. For non-integer values, the Gamma function extends the factorial concept, but it is not implemented in this calculator.
How large a factorial can this calculator handle?
This calculator uses JavaScript BigInt, which supports arbitrarily large integers limited only by your device's available memory. You can compute factorials of thousands.
Is my data sent to a server?
No, all calculations are performed entirely in your browser using JavaScript. No data is transmitted to any server, ensuring complete privacy.
What is the factorial formula?
The factorial formula is: n! = n × (n-1) × (n-2) × ... × 2 × 1, for n ≥ 1. The recursive form is n! = n × (n-1)! with base case 0! = 1.
How fast can this calculator compute large factorials?
Computation is nearly instantaneous for small values. For larger numbers (e.g., 1000!), it typically completes within milliseconds, depending on your device's processing power.
Who invented factorials?
The factorial concept has ancient roots, but the modern notation n! was introduced by French mathematician Christian Kramp in 1808. Factorials have been studied in Indian mathematics since at least the 12th century.