Why GIFs are so heavy
GIF was designed in the late 1980s for simple graphics, and animation was added on top: each frame is stored as an image with at most 256 colours, using a compression method that knows nothing about motion. A few seconds of real footage quickly adds up to many megabytes.
MP4 video with H.264 works differently. It stores full-colour frames and describes most of them by how they differ from the frames around them, so areas that do not change cost very little. The same animation as an MP4 is therefore usually much smaller than the GIF, which means faster pages and messages that fit within attachment and upload limits.
Long, large GIFs tend to gain the most: clips of real footage, screen recordings and reaction GIFs saved from the web. A tiny icon with a handful of frames has much less to gain, and may be better left as it is.
What is kept and what changes
- Timing: the delay of each frame is kept, so the animation plays at the same speed as the GIF.
- Transparency: MP4 video has no transparency, so transparent areas of the GIF become white.
- Looping: a GIF loops by itself; an MP4 file does not. Players and web pages can loop it, but the file on its own plays once.
- Colours: nothing is added; the video shows the GIF's existing colours. Because video compression is lossy, fine pixel art or tiny text can look slightly softer than in the GIF.
- Sound: GIFs have no audio, so the MP4 is silent.
Making the MP4 loop
Where you control the player, looping is a setting. On a web page, the HTML video element can play the MP4 the way a GIF would: <video autoplay loop muted playsinline> starts it silently, repeats it endlessly and keeps it inline on phones. Many chat apps and social networks loop short videos automatically, and most video players have a repeat option.
If the image has to stay a GIF, for example for a place that accepts only images, keep the original. And if you only need a single still frame, GIF to PNG saves the first frame as a lossless image.
GIF and MP4 compared
| Animated GIF | MP4 (H.264) | |
|---|---|---|
| Colours | Up to 256 per frame | Full colour |
| Compression | Lossless, frame by frame | Lossy, using the similarity between frames |
| Typical file size | Large | Usually much smaller |
| Transparency | On or off per pixel | None (transparent areas become white) |
| Looping | Built in | Set by the player or page |
| Best for | Places that accept only images | Web pages, messages, uploads |
Browser requirements and limits
MP4 encoding uses the video encoder built into your browser. Current Chrome, Edge and Safari support it, and Firefox does where the operating system provides H.264 encoding. If yours cannot encode video, you get a clear message instead of a broken file.
GIFs of up to 1 GB are accepted, one at a time, and they are converted entirely on your device; nothing is uploaded. Going the other way is just as easy: MP4 to GIF turns a video clip into a looping GIF when a destination accepts images only.