GIF vs MP4
For anything longer than about two seconds, MP4 is smaller than GIF by an enormous margin — often ten times — and looks better doing it. GIF survives only because it plays inline everywhere without a video player.
Last updated
Choose GIF when
- Very short loops in email, where video will not play.
- Places that accept images but not video.
- Stickers and reactions on platforms built around GIF.
Choose MP4 when
- Anything more than a couple of seconds long.
- Screen recordings, which GIF renders badly and enormously.
- Anywhere the file size matters at all.
What GIF actually is
GIF holds at most 256 colours chosen per image, and it can hold several frames with delays between them, which is why it became the format for short looping animation. Its transparency is a single colour switched on or off, with no partial values, so edges against a coloured background look ragged.
A ten-second GIF is often larger than the MP4 it came from and looks considerably worse. The 256 colour limit, not the length, is what does the damage.
What MP4 actually is
MP4 is a container: it holds a video stream, usually H.264, an audio stream, usually AAC, and any subtitles or chapter data, and describes how they line up. Almost every device made in the last fifteen years plays that combination in hardware, which is why MP4 became the default.
Two MP4 files can behave completely differently depending on the codecs inside. A file that will not play is usually an unusual codec in an ordinary container, not a broken file.
GIF and MP4 side by side
| GIF | MP4 | |
|---|---|---|
| Extension | .gif | .mp4 |
| Media type | image/gif | video/mp4 |
| Compression | Lossless | Lossless |
| Transparency | Yes | No |
| Animation | Yes | No |
| Quality setting | Not applicable | Not applicable |
| We can write it | Yes | Yes |
Questions
Why is my GIF 40 MB?
GIF stores every frame as a separate image with at most 256 colours and no motion compression. A ten-second screen recording is a hundred-odd full images in a row. The same clip as MP4 is usually under 2 MB.
Do social platforms accept MP4 instead of GIF?
Most convert your GIF to video on upload anyway. Giving them MP4 to begin with skips a re-encode and looks better.