Factorial Calculator
Calculate the factorial of a number, plus the number of trailing zeros in the result.
Last updated · View algorithm, constants and default inputs (JSON)
About this calculator
For a nonnegative whole number n, n! multiplies every integer from 1 through n; 0! is 1. The numeric factorial output is exact through 18! and may be rounded by floating-point arithmetic above that. Digit and trailing-zero counts are computed separately.
Worked example
calculated with the default values below
Number 10 Factorial (approximate above 18!) 3,628,800 · Digits in result 7 · Trailing zeros 2
General background references
Disclaimer
These calculators give general mathematical results. They suit study, planning and estimation — verify anything that feeds a graded submission, a published figure or a financial commitment.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
n! = Π_{i=1}^{k} i; D = floor(Σ_{i=1}^{k} log10 i) + 1; Z = Σ_{j: 5^j ≤ k} floor(k ÷ 5^j)
- k
- floor of n
- n!
- factorial
- D
- digit count
- Z
- trailing zeros
Input must be an integer 0–170. 0! = 1. Floating-point factorial values can round above 18!; digit count uses log10 sums and trailing zeros use powers of five.
Frequently asked questions
Are large factorial values exact?
The digit and trailing-zero counts are computed separately, but the factorial itself uses floating-point arithmetic. Integer results are exact through 18!; larger displayed values may be rounded. The input accepts whole numbers from 0 to 170, and 0! equals 1.