Maths & numbers

Factorial trailing zeros calculator

Count factors of ten in a factorial without expanding the product.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

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.

THE FORMULASum floor(n/5ᵏ) for positive k

A 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.

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

Find your calculator

Start typing to explore the library.