Factorial calculator guide
The factorial of a non-negative integer n, written n!, is the product of all positive integers less than or equal to n. By definition 0! = 1 and 1! = 1; for n ≥ 2 the value is n × (n − 1) × ⋯ × 2 × 1. Factorials appear throughout combinatorics, probability, algebra, and calculus — they count permutations, sit in binomial coefficients, and scale the terms of Taylor series.
Enter a whole number from 0 to 500 and select Calculate. The calculator multiplies with exact big-integer arithmetic, so 25! is the full 26-digit integer, not a floating-point approximation. When n is greater than 20 the result also includes a six-significant-digit scientific form for a quicker sense of magnitude. Stirling’s approximation is discussed below only as optional context; it is not used in the calculation.
How to use this factorial calculator
- Enter n: Type a non-negative integer from 0 to 500. Decimals, negatives, and empty input are rejected. Quick buttons fill 0, 5, 10, or 20.
- Select Calculate: Press Calculate, or press Enter in the input. Invalid values produce the error “Enter an integer from 0 to 500.” instead of a result.
- Read the exact factorial: The large label is n!. Beneath it is the exact integer as a decimal string, followed by the number of digits. For n greater than 20 a scientific approximation with six significant digits is shown as well.
- Reset or share: Reset returns to the example 10! = 3,628,800. Copy the link to share the current n — the value is encoded in the page URL.
Formula and variables
The product definition multiplies every positive integer up to n. Equivalently, n! = n × (n − 1)! with the base case 0! = 1, which keeps binomial coefficients, empty products, and the identity n! / (n − 1)! = n consistent at n = 1. This calculator evaluates the product with exact integers; it does not evaluate the gamma function Γ(n + 1) and does not apply Stirling’s approximation.
n! = n × (n − 1) × ⋯ × 2 × 1 for n ≥ 1, and 0! = 1- n — Input integer
- A non-negative whole number from 0 to 500. (unitless integer)
- n! — Factorial
- The product of all positive integers up to n, with 0! defined as 1. (unitless integer)
Worked example: calculate 10!
Find 10!, the default example loaded by the calculator, by writing the product and multiplying from the top down.
- n
- 10
- Write the product: 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1.
- 10 × 9 = 90.
- 90 × 8 = 720.
- 720 × 7 = 5,040.
- 5,040 × 6 = 30,240.
- 30,240 × 5 = 151,200.
- 151,200 × 4 = 604,800.
- 604,800 × 3 = 1,814,400.
- 1,814,400 × 2 = 3,628,800.
- 3,628,800 × 1 = 3,628,800.
Result: 10! = 3628800 (7 digits)
Ten factorial is 3,628,800. That is also the number of ways to arrange 10 distinct objects in a line, because the first position has 10 choices, the second 9, and so on down to 1. The calculator reports the same integer without commas, plus a digit count of 7. Scientific notation is omitted because n is not greater than 20.
Understanding your results
Exact factorial
The monospace value is n! as an exact integer. There is no rounding: 20! is 2,432,902,008,176,640,000 and 25! is 15,511,210,043,330,985,984,000,000. Use this string when you need the precise product, for example as a denominator in a combination formula.
Digit count
Digits is the number of decimal digits in the exact value. 5! = 120 has 3 digits, 10! has 7, and 25! has 26. Digit count is a quick check that a transcribed result was copied in full.
Scientific notation (n > 20)
When n is greater than 20 the calculator also reports the first six significant digits of n! times a power of ten: 25! ≈ 1.55112 × 10^25, because 25! has 26 digits. This compact form is a magnitude check only; the exact integer remains the primary result. Values of n from 0 through 20 omit scientific notation because the full integer is short enough to read at a glance.
Assumptions
- n is a non-negative integer; factorial is not defined for negative integers in ordinary arithmetic, and this calculator does not evaluate non-integer arguments.
- 0! = 1 and 1! = 1 by definition.
- The product is computed exactly with big integers, not with floating-point numbers.
- n is at most 500, which keeps the exact product responsive in the browser.
Limitations
- Negative integers, decimals, and empty input are rejected rather than being mapped to the gamma function.
- n greater than 500 is rejected. The legacy 10,000 cap could freeze the page; 500! already has more than 1,100 digits.
- Stirling’s approximation n! ≈ √(2πn) (n/e)^n is not used. It is an optional estimate for very large n, not part of this calculation.
- Double factorial n!!, multifactorial, and subfactorial !n are outside the scope of this calculator.
Common mistakes
- Treating 0! as 0. The empty product is 1, and binomial coefficients such as C(n, 0) = n! / (0! n!) require 0! = 1.
- Entering a decimal such as 5.5; n! for non-integers belongs to the gamma function Γ(n + 1), which this calculator does not evaluate.
- Expecting a factorial of a negative integer. For negative integers the factorial (and the gamma function at those poles) is undefined.
- Confusing n! with n² or with n × (n − 1). 5! is 120, not 25 and not 20.
- Reading scientific notation as the exact answer. For n > 20 the six-digit form is a magnitude check; the full integer is listed above it.
- Computing n! / k! by evaluating both factorials fully when n is only a little larger than k. Cancel first: 10! / 7! = 10 × 9 × 8 = 720.
Practical use cases
Count permutations
The number of ways to arrange n distinct objects is n!. Five books on a shelf can be ordered in 5! = 120 ways; ten distinct digits can be lined up in 10! = 3,628,800 ways.
Build combinations and binomial coefficients
C(n, r) = n! / (r! (n − r)!) and P(n, r) = n! / (n − r)! are built from factorials. Use this calculator to check the n!, r!, and (n − r)! pieces, or the combinations and permutations calculator for the full count.
Check series and probability terms
Taylor and Maclaurin terms divide by n!, and many discrete probability models (Poisson, binomial) include n! in the denominator. An exact factorial keeps those terms from rounding too early.
Planning and decision guide
Cancel before you multiply when dividing factorials
For n! / k! with n > k, write n × (n − 1) × ⋯ × (k + 1) instead of expanding both products. 100! / 98! is simply 100 × 99 = 9,900, which you can do by hand even though 100! itself is enormous.
Use Stirling only as a magnitude check for huge n
Stirling’s approximation n! ≈ √(2πn) (n/e)^n estimates how large a factorial is when n is far beyond this calculator’s range. It is not a substitute for the exact product, and this page never applies it. For n ≤ 500 the exact integer is always available here.
Choose the right related tool
This calculator returns a single factorial. To count selections or arrangements, use the combinations and permutations calculator. To convert between number bases after a counting argument, use the binary calculator.
Frequently asked questions
What is a factorial?
n! is the product of all positive integers up to n. For example 5! = 5 × 4 × 3 × 2 × 1 = 120. The notation n! is read “n factorial.”
Why is 0! equal to 1?
0! is defined as 1 so that the empty product is 1 and identities such as n! = n × (n − 1)! and C(n, 0) = 1 remain true at n = 0 and n = 1. There is one way to arrange an empty list: do nothing.
Can I calculate the factorial of a negative number or a decimal?
No. Ordinary factorial is defined only for non-negative integers. Negative integers are undefined, and non-integers belong to the gamma function, which this calculator does not evaluate. Enter a whole number from 0 to 500.
Why is n limited to 500?
Exact n! grows extremely fast: 25! already has 26 digits and 500! has more than 1,100. The calculator uses big integers so the value stays exact, but a much larger cap (the legacy limit of 10,000) can freeze the page. Inputs outside 0–500 are rejected.
When does the calculator show scientific notation?
When n is greater than 20. The scientific line takes the first six significant digits of the exact integer and a power of ten equal to (digits − 1). For example 25! ≈ 1.55112 × 10^25. The exact integer is still shown in full.
Does this calculator use Stirling’s approximation?
No. Stirling’s formula n! ≈ √(2πn) (n/e)^n is an optional estimate for very large n. This calculator multiplies 1 through n with exact integers and never applies Stirling’s approximation.
How are factorials used in permutations and combinations?
The number of permutations of n distinct items is n!. More generally P(n, r) = n! / (n − r)! counts ordered arrangements of r items from n, and C(n, r) = n! / (r! (n − r)!) counts unordered selections.
Sources and review
- Factorial — MathWorld — A Wolfram Resource. Accessed 2026-08-23.
- The factorial function — Khan Academy. Accessed 2026-08-23.
- Factorial Function ! — Math Is Fun. Accessed 2026-08-23.
Reviewed 2026-08-23.