Trailing Zeros in Factorials

Loading...

What are Trailing Zeros?

Trailing zeros are the consecutive $0$s at the end of an integer. For example, $10$ has one trailing zero, $100$ has two, and $1$,$000$,$000$ has $6$.

Notice the following pattern:

$$10^1=10$$

$$10^2=100$$

$$10^3=1,000$$

$$10^4=10,000$$

The number of trailing zeros depends entirely on the number of powers of $10$ in our integer. If we have one power of $10$, we have one trailing zero. If we have eight powers of $10$, we have $8$ trailing zeros. 

Let's Look at an Example

How many trailing zeros are there in $270!$? In other words, how many powers of $10$ are there in $270!$?

$$\frac{270!}{10^x}$$

To apply our "trick," we have to break $10$ down into the primes $2 \times 5$, and we know that $5$s are less common than $2$s, so $5$s are our limiting factor. So rewrite the problem as and then apply our trick (learned previously)...

$$\frac{270!}{5^x}$$

Continuously divide by $5$ and take the whole number result 

$$54...10...2...0 = 66$$

So $270!$ has $66$ zeros at the end. You can see the number here in all its glory if you'd like to confirm.

© 2026 GregMat. All rights reserved.