How this calculation works
There are more factors of 2 than 5 in a factorial, so the factors of 5 determine the number of final decimal zeros.
Sum floor(n/5ᵏ) for positive kA worked example
100! has 20 multiples of 5 plus four additional factors from multiples of 25.
Good to know
This counts zeros in base ten.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Count factors of ten in a factorial without expanding the product.
The primary result is labeled “Trailing zeros”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
This counts zeros in base ten.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
100! has 20 multiples of 5 plus four additional factors from multiples of 25.
Which rule does this calculator apply?
Sum floor(n/5ᵏ) for positive k