Factorial Calculator
Enter a non-negative integer to calculate its factorial.
How factorials work
The factorial of a number n, written n!, is the product of all positive integers from 1 up to n: n! = n × (n−1) × (n−2) × ... × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
By definition, 0! equals 1 (an empty product). Factorials grow extremely fast — 10! is already 3,628,800, and 170! is about as large as a standard number can represent before overflowing.
Frequently asked questions
Why is 0! equal to 1?
By convention, the factorial of 0 is defined as 1 — it represents the empty product (multiplying zero numbers together), which is mathematically 1, the same way an empty sum is 0.
What are factorials used for?
Factorials are fundamental in combinatorics — counting the number of ways to arrange items (permutations) or choose a subset of items (combinations) — as well as in probability, calculus (Taylor series), and statistics.
Why does the calculator stop at 170?
170! is the largest factorial that fits within standard double-precision floating-point number range; 171! and beyond would overflow to infinity in this format.