Factorial Calculator
Calculate the exact factorial of a whole number from 0 through 1000. Enter n to see n!, the product definition and a short explanation. Zero factorial is supported and equals 1.
How to use
Enter a whole number from 0 through 1000 and select Calculate. Read the exact integer and the product explanation. Editing the input clears the old answer; Reset returns to 5! = 120. Remove commas and do not enter an expression or a decimal.
Formula
Step by step
- Validate that n is a whole number between 0 and 1000.
- Begin with an exact integer accumulator equal to 1.
- Multiply by each integer from 2 through n; for zero or one no multiplication is needed.
- Display every digit of the result without floating-point rounding.
Detailed calculation guide
The factorial of a nonnegative whole number is the product of all positive integers up to that number. The notation is n!, with the exclamation mark indicating the factorial operation. For example, 5! means 1 × 2 × 3 × 4 × 5, which is 120. The factorial operation is different from exponentiation: 5 squared is 25, while 5 factorial is 120.
Zero is a special case in the product definition. There are no positive integers to multiply when n is zero, so the empty product is defined as 1. This agrees with the recurrence n! = n × (n − 1)! at n = 1, because 1! = 1 × 0! requires 0! to equal 1. One factorial is also 1.
This tool multiplies exact integers using JavaScript BigInt. It does not store the answer in a floating-point Number, which would lose integer digits for larger values and eventually overflow. Every displayed digit belongs to the exact result. The supported range is 0 to 1000; this is a deliberate input and output limit, not a claim that larger factorials do not exist. The full result for 1000! has 2568 digits, so a long result may require scrolling.
Only whole-number inputs within the supported range are accepted. Negative numbers, decimals, expressions, scientific notation and comma-separated numbers are rejected. If you edit the input, the previous answer is cleared until you select Calculate. An invalid entry clears the previous result and shows a specific message rather than retaining an answer belonging to another input.
Factorials count arrangements of distinct objects when order matters. For five distinct books on a shelf, there are 5! = 120 different orders. Repeated or indistinguishable objects require an adjusted formula, and choosing only part of a collection calls for permutations or combinations. This calculator evaluates the factorial itself; it does not decide which counting model matches your problem.
The gamma function extends related ideas beyond nonnegative integers, but that extension is outside this form’s scope. A decimal entry should not be rounded silently to make it fit. Enter the intended whole number, verify the definition in the worked examples, and use the exact integer output when a later calculation needs all digits.
Zero factorial
1
The empty product is 1, so 0! = 1.
One factorial
1
The single factor is 1.
Five distinct objects
120
1 × 2 × 3 × 4 × 5 = 120.
Ten factorial
3628800
Multiplying the integers from 1 through 10 gives 3628800.
Beyond floating-point integer precision
51090942171709440000
The result is an exact integer; every digit is preserved.
Frequently asked questions
What is zero factorial?
Zero factorial is 1. It is the empty product and makes the factorial recurrence consistent at n = 1.
Can I enter a negative number or a decimal?
No. This tool evaluates the ordinary factorial of nonnegative whole numbers only. It does not evaluate the gamma function.
Is the large result rounded?
No. The implementation uses exact BigInt multiplication and displays the complete integer, including values beyond Number precision.
Why does the tool stop at 1000?
The range bounds computation and the size of the displayed answer. Factorials beyond 1000 exist, but are outside this tool’s supported input range.
Does factorial mean raising a number to a power?
No. A factorial multiplies the consecutive positive integers up to n. A power repeatedly multiplies a base by itself.
Browse all calculators in this category
Editorial review
Author: JD
Sources
Enable JavaScript to use interactive calculators.