How to convert a GIF to MP4
- Drop the GIF on the box above, or click to choose one (up to 50 MB).
- Conversion starts immediately and takes a few seconds on a laptop — in our tests, under six seconds even for a 33 MB GIF.
- Play the MP4 next to the original to check it. If the GIF had see-through areas, choose whether they become white or black.
- Click Download MP4.
Why the MP4 is so much smaller
A GIF is a sequence of palette images, each squeezed with LZW, a lossless method from the 1980s. At best it can skip the pixels that didn’t change since the last frame. H.264 goes much further: it predicts each frame from the ones around it, including movement — a window sliding across the screen is stored as “this block moved 12 pixels left” rather than as new pixels. It also discards detail the eye doesn’t notice and stores colour at lower resolution than brightness, which is invisible on screen content.
The result is counter-intuitive: the MP4 is both far smaller and better looking, because it isn’t limited to 256 colours per frame. Gradients, shadows and photos inside a screen recording come through without the banding a GIF palette causes.
Measured on real screen-recording GIFs
Four GIFs, converted on this page in two browser engines. The first three were made from our own raw screen captures at 15 fps; the fourth is a real-world GIF that had already been through a good encoder.
| GIF | GIF size | MP4 (Chrome) | MP4 (Safari engine) |
|---|---|---|---|
| Desktop, 5 s, 1280 px | 4.2 MB | 0.37 MB · 11.2× smaller | 1.2 MB · 3.5× smaller |
| Desktop, 15 s, 1280 px | 18.9 MB | 3.4 MB · 5.5× smaller | 3.1 MB · 6.1× smaller |
| iPhone, 28 s, 480 px | 33.2 MB | 6.0 MB · 5.5× smaller | 3.0 MB · 11.0× smaller |
| Real-world GIF, 3.6 s | 4.7 MB | 1.1 MB · 4.2× smaller | 2.0 MB · 2.3× smaller |
Each browser ships its own H.264 encoder, and they make different trade-offs: the same 5-second GIF came out 11× smaller in Chrome but 3.5× smaller in Safari’s engine, while the 28-second one went the other way. Either way, every GIF we tried shrank at least twofold.
Using the MP4 where you used the GIF
On a web page, a video tag with four attributes behaves exactly like a GIF — it starts on its own, loops, stays silent and plays inline on iPhone instead of going full screen:
<video src="demo.mp4" autoplay loop muted playsinline></video>muted matters: browsers only autoplay video that is muted. playsinline stops iOS Safari from opening it full screen. Everywhere else, upload the MP4 as you would a video: GitHub issues, pull requests and comments accept MP4 uploads and play them in place. Chat apps and social sites each handle short silent clips their own way, so check how yours plays them.
Keep the GIF where only images are accepted — a README image embedded with Markdown’s ![]() syntax, email newsletters, and many documentation tools. For those, shrink it with the GIF Compressor instead.
What changes in the conversion
- Timing — kept frame for frame. Delays under 20 ms become 100 ms, matching how browsers already play such GIFs.
- Size — unchanged, except that odd widths or heights gain one pixel of background colour, because H.264 needs even dimensions.
- Transparency — filled with white or black; video has no alpha channel.
- Looping — not stored in the file. Set it where the video plays.
- Format — H.264 in an MP4 container, which plays everywhere. Browsers that can’t encode H.264 get a VP9 WebM file instead, and the tool labels it.