onlinecalculator.me

Factorial calculator — n!

The factorial of n (written n!) is the product of all positive integers from 1 to n. This calculator shows the exact value for small inputs and scientific notation for large ones.

n! =

About this calculator

Formula

n! = n × (n−1) × (n−2) × … × 2 × 1
0! = 1 (by definition)

Common values

nn!
01
5120
103,628,800
202.433 × 10^18
503.041 × 10^64
1009.333 × 10^157
What is a factorial?
n! = n × (n−1) × (n−2) × … × 2 × 1. By definition, 0! = 1. Factorials grow extremely fast: 10! = 3,628,800 and 100! has 158 digits.
Why does the calculator switch to scientific notation above 170?
JavaScript's floating-point numbers (IEEE 754 doubles) overflow at about 1.8 × 10^308. Since 171! ≈ 1.24 × 10^309, exact computation exceeds the representable range. The calculator uses a logarithm-based approach to show the scientific notation accurately.
What is 0! and why is it 1?
By convention, 0! = 1. This preserves the identity n! = n × (n−1)! when n = 1 (giving 1 = 1 × 0! = 1 × 1) and makes combinatorial formulas like C(n,0) = 1 work correctly.
How many digits does 100! have?
100! has 158 digits. The digit count equals floor(log10(n!)) + 1.
How do I share my calculation?
Click "Share with my numbers" to copy a URL that saves your input.