Factorial Calculator (n!)
n! = 1 × 2 × … × n. Computes exactly up to 21! (number limit); approximate via Stirling for larger.
Result
n!
3628800
Exact value.
- n10
- Exact n!3628800
- Approx digits7
- Stirling ln(n!)15.0961
- log10(n!) approx6.5561
Step-by-step
- n! = 1 × 2 × … × 10 = 3628800.
- Stirling: ln(n!) ≈ n ln n − n + ½ ln(2πn) = 15.0961.
- n! has approximately 7 digits.
How to use this calculator
- Enter n (0 to 200 or so).
- Read exact value or Stirling approximation.
About this calculator
n! ("n factorial") is the product of all positive integers up to n. 5! = 120; 10! = 3,628,800; 21! = 51,090,942,171,709,440,000 (last one fitting in JS Number). For larger n, this calculator uses Stirling's approximation: ln(n!) ≈ n ln n − n + ½ ln(2πn), accurate to <1% for n > 5. Factorials grow superexponentially: 100! has 158 digits, 1000! has 2568. Used in combinatorics (permutations), Taylor series, probability.
Frequently asked
JavaScript Number is IEEE 754 double — 53-bit precision. 21! = 5.1 × 10^19, just past 2^53. Larger values lose precision.
Related calculators
Prime Number Checker
Is n prime? Trial division up to √n; identifies smallest divisor and nearest primes if composite.
Prime Factorization Calculator
n = p₁^a₁ × p₂^a₂ × … Trial division to find all prime factors with multiplicity.
GCD (Greatest Common Divisor) Calculator
Euclidean algorithm: gcd(a,b) = gcd(b, a mod b). Supports 2-6 integers.
LCM (Least Common Multiple) Calculator
lcm(a,b) = |a × b| / gcd(a,b). Smallest number that both a and b divide evenly.
Scientific Notation Converter
Convert decimal ↔ scientific notation. Standard form a × 10^b with 1 ≤ |a| < 10.
Square Root Calculator (√n)
√n with integer-perfect-square check, simplified surd form, and decimal expansion.