What this calculator does
The factorial of a whole number is the product of every positive integer up to that number. It appears in permutations, combinations, probability, Taylor series, and the binomial theorem. The definition is simple, but the numbers grow extremely fast: 10! is already 3.6 million, 20! is 2.4 quintillion, and 52! has 68 digits. Ordinary floating-point arithmetic loses exactness well before that, so this calculator uses arbitrary-precision integer arithmetic to return the exact digits. It also reports the digit count, the number of trailing zeros, the base-10 logarithm, and a scientific-notation form. The result is useful for checking a hand calculation, for combinatorics problems, and for seeing how quickly factorials outgrow everyday numbers. Factorials are defined for non-negative integers; the calculator rounds the input and clamps it to the supported range.
How to use it
- Enter a whole number between 0 and 1,000.
- Read the exact factorial for the value of n.
- Check the digit count and trailing zeros for a quick sanity check.
- Use the scientific notation when the exact number is too long to read.
- Compare the base-10 logarithm with the digit count to see the scale.
- Remember that 0! is 1 by definition, not 0.
How it works
Example calculations
Example 1: 10!
10! = 1 x 2 x ... x 10 = 3628800. It has 7 digits and 2 trailing zeros. The trailing zeros come from the factors 2 and 5, and from the extra factor of 5 in 10. The scientific form is 3.62880 x 10^6.
Example 2: 20!
20! = 2432902008176640000. It has 19 digits and 4 trailing zeros. The exact value is too large for a standard JavaScript number to represent without loss, which is why the calculator uses arbitrary-precision arithmetic. The base-10 logarithm is 18.3861.
Example 3: 52!
52! has 68 digits and 12 trailing zeros. It is the number of ways to order a standard deck of cards, a useful reminder of how fast factorials grow. The exact value begins 806581751709... and the scientific form is 8.06582 x 10^67.
What the result means
The exact value is the main result, but the digit count and trailing zeros are useful checks. The digit count grows roughly linearly with n log n: 10! has 7 digits, 20! has 19, and 52! has 68. The trailing-zero count is the number of factors of 10, which is controlled by the number of factors of 5. The scientific notation is the practical way to compare factorials of different sizes, while the exact integer is the answer to a combinatorial problem. For n above 1,000 the calculator clamps the input; the exact value would be enormous and rarely useful in a browser.
Common mistakes
- Assuming 0! is 0 when it is defined as 1.
- Using a floating-point calculator for large n and trusting the trailing digits.
- Counting trailing zeros from the final digit instead of the factors of 5.
- Confusing n! with the nth power of n.
- Forgetting that factorial is only defined for non-negative integers in this context.
- Treating the scientific notation as the exact value rather than an approximation.
Assumptions and limits
- n is a whole number; the calculator rounds the input.
- The supported range is 0 to 1,000.
- Exact arithmetic is used, so the digits are not subject to floating-point rounding.
- 0! is 1 by definition.
- The scientific notation is rounded for display.
- The calculator does not evaluate the gamma function for non-integers.
Frequently asked questions
What is 0! and why?
0! is 1 by definition. It makes the formulas for permutations and combinations work when there are no items to arrange, and it is consistent with the recurrence n! = n x (n-1)! at n = 1. The calculator follows that convention.
How large a factorial can the calculator handle?
It supports whole numbers from 0 to 1,000. 1,000! has 2,568 digits and is computed exactly with arbitrary-precision arithmetic. Larger inputs are clamped to 1,000 to keep the page responsive.
Why does 20! look different from a normal calculator?
Many calculators use floating-point numbers, which lose exactness above about 15 to 17 digits. 20! has 19 digits, so the last digits may be rounded. This calculator uses exact integer arithmetic, so every digit is correct.
How do you count trailing zeros?
Each trailing zero comes from a factor of 10, which needs a factor of 2 and a factor of 5. There are always more factors of 2 than 5, so the count is the number of factors of 5: floor(n/5) + floor(n/25) + floor(n/125) + ... . For 20! that is 4 + 0 = 4.
Can I use this for permutations and combinations?
Yes, factorials are the building blocks. The permutation and combination calculator uses them directly. For large n, the exact factorial is often too big to be useful, and the log or scientific form is a better guide to the scale.
Does the calculator support negative or fractional factorials?
No. The factorial function in this tool is for non-negative integers. Negative integers are not defined, and fractional values require the gamma function, which is a different calculation and is not included here.
Sources
2026 update
How to use the professional output
This page is not just a formula box. The result is designed to be checked, compared, and taken away.
- Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
- A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
- Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.
The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.