Skip to content
Math & Scientific

Factorial Calculator

Factorial Calculator

Compute n! for whole numbers from 0 to 20, with every multiplication step shown.

How many ways can five runners finish a race? How many different orders can you shelve ten books? Each new item multiplies the possibilities: the first book has 10 choices, the next has 9, then 8, and so on. That product — 10 × 9 × 8 × … × 1 — is the factorial, written 10!. Factorials count arrangements, and they grow astonishingly fast: 10! is already over three million, and 20! has nineteen digits. The Factorial Calculator computes n! for any whole number from 0 to 20 and shows every multiplication step. Enter 5 to see 5 × 4 × 3 × 2 × 1 = 120. It also handles the two famous edge cases: 0! = 1 by definition, and 20! = 2,432,902,008,176,640,000 — the largest factorial that stays exact in ordinary calculator arithmetic, which is why 21 and beyond are politely declined.

What This Calculator Does

This calculator evaluates the factorial n! = n × (n − 1) × … × 2 × 1 for any whole number n from 0 to 20, exactly — no rounding, no scientific-notation shorthand. The answer is shown with thousands separators so you can read all nineteen digits of 20!, and the expansion row prints the complete multiplication chain so every step is visible. Inputs outside the exact range are refused with an explanation, not silently approximated. Negative numbers are rejected because factorials are not defined for them. Fractions are rejected because n! is only defined for whole numbers (the continuous extension is a different function entirely). Numbers above 20 are rejected because 21! no longer fits exactly in standard calculator arithmetic — the calculator protects you from an answer that looks right but has wrong low-order digits. The breakdown also reports the digit count of the answer, which is a nice window into factorial growth: 5! has 3 digits, 10! has 7, 15! has 13, and 20! has 19.

How to Use the Factorial Calculator

Type a whole number from 0 to 20 into the box — for example 5. Then press Calculate. The large result shows n! with commas, and the breakdown rows show the value of n, the full expansion (5 × 4 × 3 × 2 × 1 = 120), and the number of digits in the answer. Press Reset to clear the box and try another value. If you enter a negative number, a decimal, or anything above 20, there is no result — instead you get a clear message explaining why that input cannot have an exact factorial here.

What n! Means

The factorial n! is the product of every positive whole number from 1 up to n. So 5! = 5 × 4 × 3 × 2 × 1 = 120. The reason factorials count arrangements: with 5 books, you have 5 choices for the first shelf position, then 4 remaining choices for the second, 3 for the third, 2 for the fourth, and 1 for the last — 5 × 4 × 3 × 2 × 1 = 120 possible orders. Two boundary values deserve attention. First, 1! = 1, which is just the product of the single number 1. Second, 0! = 1 by definition. That definition is not arbitrary: there is exactly one way to arrange zero objects (do nothing), and it makes the counting formulas work smoothly — for example, the number of ways to choose all n items from n is n! / (n! × 0!), which only equals 1 if 0! = 1. Factorials grow faster than almost anything you meet in everyday arithmetic. Compare: 5! = 120, 10! = 3,628,800, 15! = 1,307,674,368,000, and 20! = 2,432,902,008,176,640,000. Each step multiplies by the next integer, so the growth accelerates — going from 19! to 20! alone multiplies the answer by 20.

Worked Examples With Full Arithmetic

Example one: 5!. Write the chain: 5 × 4 × 3 × 2 × 1. Multiply left to right: 5 × 4 = 20; 20 × 3 = 60; 60 × 2 = 120; 120 × 1 = 120. So 5! = 120. The calculator shows 120 with the expansion 5 × 4 × 3 × 2 × 1 = 120. Example two: 0!. There is no multiplication to do — the empty product is defined as 1, so 0! = 1. The calculator shows 1 with the note “by definition, 0! = 1”. Example three: 10!. Build it up from 5! = 120: 6! = 120 × 6 = 720; 7! = 720 × 7 = 5,040; 8! = 5,040 × 8 = 40,320; 9! = 40,320 × 9 = 362,880; 10! = 362,880 × 10 = 3,628,800. The calculator shows 3,628,800 with the full chain 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1. Example four: 20!. Continue from 15! = 1,307,674,368,000: 16! = 1,307,674,368,000 × 16 = 20,922,789,888,000; 17! = 20,922,789,888,000 × 17 = 355,687,428,096,000; 18! = 355,687,428,096,000 × 18 = 6,402,373,705,728,000; 19! = 6,402,373,705,728,000 × 19 = 121,645,100,408,832,000; 20! = 121,645,100,408,832,000 × 20 = 2,432,902,008,176,640,000. That is 19 digits. The calculator shows 2,432,902,008,176,640,000 with the digit count 19. Example five: arrangements. Four runners finish a race — how many finishing orders are possible? The first place has 4 candidates, second place 3, third 2, fourth 1: 4! = 4 × 3 × 2 × 1 = 24 orders. The calculator confirms 4! = 24. Example six: 21. Since 21 exceeds the exact range, the calculator refuses with the message that n must be 20 or less so the answer stays exact. (For reference, 21! = 51,090,942,171,709,440,000, which needs more precision than ordinary calculator arithmetic carries.)

How to Read Your Result

The large number is n! written out in full with thousands separators — no exponents, no rounding. Above it, the label names the computation, such as “5!”. The breakdown rows show the input n, the complete expansion with the final value (5 × 4 × 3 × 2 × 1 = 120), and the digit count of the answer. If you entered something the calculator cannot handle — a negative, a decimal, or a number above 20 — there is no result box at all. Instead an error message explains the restriction in plain language.

Common Mistakes to Avoid

The most common mistake is thinking 0! = 0. It is 1, by definition — the empty product. This trips up nearly everyone the first time, because every other factorial is a visibly large multiplication. Another frequent error is confusing n! with n² or with n × n. 5! is not 25; it is 5 × 4 × 3 × 2 × 1 = 120. The factorial multiplies by every smaller integer, not just by n twice. People also mis-distribute factorials: (2n)! is not 2 × n!. For n = 3, (2×3)! = 6! = 720, while 2 × 3! = 2 × 6 = 12. Factorials do not split across multiplication that way. A subtler trap is trusting huge factorials from tools that round. 21! = 51,090,942,171,709,440,000 exceeds exact integer range in standard arithmetic, so naive calculators show a rounded value with wrong trailing digits. This calculator stops at 20! precisely to avoid handing you a wrong-looking-right answer. Finally, factorials apply to whole numbers only in this calculator. Expressions like (1/2)! belong to the gamma function, a continuous extension of the factorial — interesting mathematics, but a different tool.

Frequently Asked Questions

1. What is a factorial?

The factorial of n, written n!, is the product of all positive whole numbers from 1 to n: n! = n × (n − 1) × … × 2 × 1. So 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the number of ways to arrange n distinct objects.

2. Why does 0! equal 1?

By definition — the product of no numbers (the “empty product”) is 1, just as the sum of no numbers is 0. It also matches combinatorics: there is exactly one way to arrange zero objects. Without it, formulas like nCr would break at the boundaries.

3. Why does the calculator stop at 20?

Because 20! = 2,432,902,008,176,640,000 is the largest factorial that fits exactly in standard calculator arithmetic. 21! would be rounded, showing digits that are not really correct. The calculator refuses rather than approximate.

4. What is 20! exactly?

2,432,902,008,176,640,000 — nineteen digits. You can verify the build-up: 15! = 1,307,674,368,000, then ×16 ×17 ×18 ×19 ×20 gives 2,432,902,008,176,640,000. The calculator displays it in full.

5. How are factorials used in real life?

Anywhere arrangements matter: shuffling cards (52! possible orders), race finishing orders, passwords without repeated characters, scheduling round-robin tournaments, and probability — poker odds and lottery math are built on factorial-based counting.

6. What is the difference between n! and n²?

n² multiplies n by itself once (5² = 25); n! multiplies n by every smaller positive integer (5! = 120). Factorials grow far faster — by n = 10, n! is 3,628,800 while n² is only 100.

7. Can I compute factorials of decimals like 5.5?

Not with this calculator — it accepts whole numbers only. The continuous extension of the factorial is the gamma function, where (1/2)! = √π/2 ≈ 0.886. That is a different tool for a different job.

8. Why are negative factorials undefined?

The defining recurrence n! = n × (n−1)! would require dividing by zero to step below 0! = 1. (−1)! would need 0! / 0, which is meaningless. So the calculator rejects negative inputs outright.

9. How many trailing zeros does 20! have?

Four: 20! ends in …640,000. Trailing zeros come from factors of 10 = 2 × 5, and factors of 5 are the bottleneck — floor(20/5) = 4. In general, count the multiples of 5 (then 25, 125…) up to n.

10. What is 1! ?

1 — the product of the single number 1. It is the smallest non-trivial factorial and the seed that 0! = 1 is consistent with: 1! = 1 × 0! = 1 × 1 = 1.

11. How fast do factorials grow compared to exponents?

Factorials eventually beat any fixed-base exponential. 10! = 3,628,800 already exceeds 2^10 = 1024 enormously, and the gap widens because each factorial step multiplies by a larger number while 2^n always multiplies by 2.

12. Can the calculator show the steps for 20!?

Yes — the expansion row prints the entire chain 20 × 19 × … × 1. It is long, but it is complete, and the digit-count row confirms the 19-digit result.

13. What does the digit count tell me?

How many decimal digits the answer has: 3 for 5!, 7 for 10!, 13 for 15!, 19 for 20!. It is a quick way to feel factorial growth without reading every digit.

14. Is 100! really larger than the number of atoms in the universe?

Yes — 100! ≈ 9.33 × 10¹⁵⁷, while the observable universe holds roughly 10⁸⁰ atoms. Factorials reach cosmic scales shockingly early, which is why card shuffles (52! ≈ 8 × 10⁶⁷) are effectively always unique.

15. Why do probability formulas use factorials?

Because probability counts favorable outcomes versus total outcomes, and both are arrangement counts. The combinations formula nCr = n! / (r! × (n−r)!) is the classic example — factorials in the numerator and denominator count the orderings being compared.

Final Thoughts

The factorial is a small notation for an enormous idea: multiply by every smaller number and watch arrangements explode. The Factorial Calculator keeps the computation honest — exact values only, every step shown, and a firm stop at 20! where exactness ends. Whether you are counting race finishes, checking homework, or just marveling at a nineteen-digit number, it gives you the full product, the full chain of multiplications, and nothing rounded or hidden.