Trailing zeros calculator
Count the trailing zeros at the end of any number, or find how many trailing zeros n! has.
Number
Trailing zeros
Trailing zeros are the consecutive zeros at the end. 1000000 has 6. 10200 has 2.
Trailing zeros in n!
Each trailing zero needs a factor of 10 = 2×5. Since there are always more 2s than 5s, count fives: ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + ...
100! has ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 trailing zeros.
Related calculators