Factorial Calculator
Enter a whole number to calculate its factorial (n!) exactly — no floating-point rounding, even for results with hundreds or thousands of digits. Factorial is the same building block used behind the scenes by the Permutations & Combinations Calculator.
Factorial
Digit Count
≈ Scientific Notation
Exact Value
Show all digits
Copied to clipboard.
What Is a Factorial?
The factorial of a whole number n, written n!, is the product of every whole number from n down to 1: n! = n × (n − 1) × (n − 2) × ... × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials show up constantly in counting problems because they represent the number of different ways to arrange a set of distinct items in order — with 5 distinct books on a shelf, there are 5! = 120 possible orderings. That's exactly why factorial is the building block underneath the nPr and nCr formulas used in the Permutations & Combinations Calculator.
By convention, 0! = 1. That might look strange at first since there's nothing to multiply, but it makes sense once you think about arrangements: there is exactly one way to arrange zero items — the "empty arrangement," where you simply do nothing. Defining 0! = 1 also keeps other formulas (like combinations and the binomial theorem) working correctly at their edges, so mathematicians adopted it as the standard convention rather than leaving it undefined.
How Fast Does Factorial Grow?
Factorial grows faster than almost any other common mathematical operation — far faster than exponential growth. Each new term multiplies by a larger number than the last, so the result balloons very quickly. The table below shows just how explosive that growth is:
| n | n! |
|---|---|
| 5! | 120 |
| 10! | 3,628,800 |
| 15! | 1,307,674,368,000 |
| 20! | ≈ 2.43 × 10¹⁸ |
| 50! | ≈ 3.04 × 10⁶⁴ |
| 100! | has 158 digits |
By the time you reach 100!, the exact result already has 158 digits — far more than any standard calculator display can show, and well beyond what ordinary floating-point numbers can represent precisely. This calculator sidesteps that limit entirely by using exact big-integer arithmetic instead of regular floating-point numbers, so every digit you see is correct no matter how large n gets (up to the 1,000 cap below).
How to Use This Calculator
- Enter a whole number from 0 to 1,000 into the input box.
- Click Calculate (or press Enter) to compute n! exactly.
- Review the digit count and scientific-notation approximation for a quick sense of scale.
- For large results, click Show all digits to reveal the full exact number, or use the Copy button to copy it directly to your clipboard.
- Try one of the quick-example buttons (5!, 10!, 20!, 100!, 500!) to see the growth pattern for yourself.
Frequently Asked Questions
Why is 0! equal to 1?
It's a mathematical convention, not a calculation in the usual sense. There is exactly one way to arrange a collection of zero items — doing nothing at all — so 0! is defined as 1 to match that idea. This definition also keeps combinatorics formulas (like nCr and the binomial theorem) consistent at their boundaries, which is why it's treated as a valid, non-error result rather than an edge case to avoid.
What is factorial used for in real life?
Factorial is the foundation of counting problems in probability and statistics: it tells you how many ways a set of items can be ordered, which feeds directly into permutations (arrangements where order matters) and combinations (selections where order doesn't). It's used in scheduling problems, shuffling and card-game odds, lottery probability calculations, and route-planning puzzles like the traveling salesman problem. Anywhere you need to count "how many different orders" or "how many different ways to choose," factorial is usually part of the formula.
What's the biggest factorial a normal calculator can compute?
Most calculators, spreadsheets, and calculator apps store numbers as standard double-precision floating-point values, which can represent numbers only up to roughly 1.8 × 10³⁰⁸. Since 170! is just under that ceiling but 171! crosses it, most everyday tools overflow to "Infinity" or an error right around 170!. This calculator avoids that limit entirely by using exact big-integer (BigInt) arithmetic instead of floating-point math, so it can compute perfectly precise results all the way up to 1,000! — which has 2,568 digits.
What is a "double factorial"?
A double factorial, written n!! (two exclamation points, not "factorial of factorial"), is the product of every other integer counting down from n to either 1 or 2. For example, 7!! = 7 × 5 × 3 × 1 = 105, and 8!! = 8 × 6 × 4 × 2 = 384. It's a different, less common operation from the regular factorial and shows up occasionally in trigonometric integrals and combinatorics — this calculator is built for the standard single-factorial (n!) only.
Does factorial work for negative numbers or fractions?
Not in the elementary sense used by this calculator. Factorial as defined here (repeated multiplication down to 1) only makes sense for non-negative whole numbers. Mathematicians do extend the idea to non-integers and even most negative numbers using something called the Gamma function, where Γ(n + 1) = n! for any whole number n — but that extension involves calculus and is well outside the scope of a simple factorial calculator like this one.
Is factorial related to prime numbers?
Not directly — factorial is about counting arrangements, while primality is about divisibility — but the two do intersect in number theory (for instance, n! + 1 is sometimes, though not always, prime). Curious whether a specific number is prime instead? Check the Prime Number Checker.