GIF vs MP4: Which One Should You Use?
If you've ever dropped a GIF into something and watched it crawl, you've met the main problem with the format. It's huge for what it does, and people still make them because GIFs work in places video doesn't. This guide is about telling those two situations apart, so you stop guessing.
What's different underneath
GIF is from 1987. Every frame is stored as a whole picture with at most 256 colours, there's no sound, and the compression only knows how to squash repeated patches of colour. So flat cartoons make decent GIFs and a photo of someone's face looks like it was printed on a sponge.
An MP4 uses a video codec, usually H.264. It stores a frame now and then and, in between, only what changed, and it throws away detail your eyes don't notice. The same few seconds take a small fraction of the space. It needs a video player to run, and a video player usually wants to be told to loop.
Same clip, four formats
| Format | Size | Compared with GIF |
|---|---|---|
| GIF | 658 KB | - |
| Animated WebP | 129 KB | about 5 times smaller |
| MP4 | 26 KB | about 25 times smaller |
| APNG | 1,046 KB | about 1.6 times bigger |
The MP4 is 26 KB. A synthetic test clip is a best case for video, so don't expect 25 times on your holiday footage, but a ratio of ten or more is normal. If you've ever wondered why the GIF of a ten-second screen recording came out at many megabytes, this is why.
Where a GIF is still the right answer
Email is the clearest case. Most email apps will animate a GIF and almost none will play a video. Outlook on Windows has long shown only the first frame, so put the important part in frame one.
A GIF also gets through anywhere the upload box says "image": forum posts, support tickets, CMS fields, some chat tools. In chat it autoplays inline and loops forever with no controls in the way, where a video usually shows a player. And it survives being pasted into a slide or a wiki, where a video link wouldn't.
Where MP4 wins
On your own website, use a video tag with autoplay, loop, muted and playsinline. Browsers only autoplay video that's muted, so if there's no sound you lose nothing, and the page loads faster and looks better.
Video also wins once a clip runs past a few seconds, because GIF size grows with every second and video barely notices. Photos, gradients and skin tones are the same story: the 256-colour limit shows up as banding, and video doesn't have it. For social posts, several large platforms convert an uploaded GIF to video behind the scenes anyway, so give them a clean MP4 yourself.
The middle option: animated WebP
WebP loops by itself like a GIF, it has full colour, and in the table above it was about a fifth of the GIF's size. Current versions of Chrome, Edge, Firefox and Safari all play it. Some chat apps, email clients and editing tools still don't accept it. If you control the page, use it. If you're sending to people on who-knows-what, a GIF is safer.
A quick way to decide
| Going to | Send | Why |
|---|---|---|
| An email newsletter | GIF, kept short | Video doesn't play in most inboxes |
| Your website or landing page | MP4 (WebP as a fallback) | Smaller, sharper, faster |
| A README or docs page | GIF, or MP4 if it supports video | Check what the page renders |
| A chat reply | GIF | Loops inline with no player |
| A social post | MP4 | The platform will recompress it anyway |
| An emoji or sticker slot | Whatever the app's rules say | Each app has its own size and format |