Convert your GIFs to MP4: same animation, far lighter
Updated: November 10, 2026
Animated GIFs are handy, but they’re a 1987 image format: they store almost every frame in full and support only 256 colours. A few-second GIF can weigh several MB and slow your site down. The same clip in MP4 is usually many times smaller and looks better.
Convert it with FFmpeg
The scale filter just ensures even dimensions, which H.264 needs. If you don’t use the terminal, many free conversion sites do the same; pick one that doesn’t add a watermark.
ffmpeg -i animation.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" animation.mp4Put it on your site like a GIF
- autoplay + muted: browsers only allow autoplay when the video is muted.
- loop: repeats like a GIF.
- playsinline: on iPhone it doesn’t open fullscreen.
- poster: an image while it loads.
<video autoplay loop muted playsinline width="480" height="270" poster="animation.jpg">
<source src="animation.mp4" type="video/mp4">
</video>If the animation is long or important
For clips longer than a few seconds, or if you want people to pause, go fullscreen and watch in good quality on any connection, upload it to Dembed and embed it with the iframe, adding ?autoplay=1 to the address: it starts by itself, muted, and in Dashboard → Player you can turn on looping.
Frequently asked questions
It depends on the animation, but it’s common for the MP4 to be 5 to 10 times smaller than the GIF.