GIF to MP4
Turn GIFs into MP4 videos. Files get up to 95% smaller with better quality.
Drop your GIF here
or click to browse
How this converter works
This turns an animated GIF into an H.264 MP4, in your browser, with ffmpeg compiled to WebAssembly. Drop the GIF, convert, download.
The output is encoded with -pix_fmt yuv420p and -movflags faststart. The first is what makes the file play in Safari and on iOS at all, since those decoders reject the 4:4:4 chroma ffmpeg would otherwise pick for a GIF source. The second moves the MP4 index to the front of the file so a browser can start playing before the whole thing has downloaded.
Odd dimensions are rounded down to even ones, because H.264 cannot encode an odd width or height and plenty of GIFs have one. That can cost you a single row or column of pixels.
Settings and limits
- Max input500 MB
- Core25 MB, once
- Threads1
More detail
Why bother
Size, mostly. A GIF stores every frame as a palettised image with only rectangle-level diffing between them, so a few seconds of motion can run to tens of megabytes. H.264 does real motion compensation and typically lands at a tenth of that or less for the same clip.
The second reason is quality. GIF caps at 256 colours per frame, so anything with a gradient has already been dithered into approximation before you started. Converting to MP4 will not undo that damage, but it stops it getting worse and it stops you paying GIF's file size for it.
What you lose
Transparency. GIF has one-bit alpha, MP4 has none, so any transparent area is flattened. If the GIF had a transparent background it will come out on whatever colour ffmpeg composites onto.
Autoplay in a few places. Some contexts that happily inline a GIF will not autoplay a video, or will show a play button instead. That is usually the reason someone wants to go the other direction.
Questions
Does my GIF get uploaded?
No. The conversion runs in your browser. The only network request is the initial fetch of the ffmpeg core from a CDN, which is cached for the rest of the session.
Why is my MP4 so much smaller than the GIF?
Because H.264 encodes the difference between frames using motion compensation, while GIF stores each frame as a full palettised image with only crude rectangle diffing. A ten-times reduction is normal and does not mean anything was thrown away that you would notice.
Will it play on iPhone?
Yes. The output uses yuv420p chroma subsampling specifically for that reason. Without it, ffmpeg would pick a format that Safari and iOS refuse to decode, and you would get a black frame or a broken player.
Can I go the other way, MP4 to GIF?
Yes, with the Video to GIF converter. Bear in mind the file will get considerably larger, because that is what GIF costs.