How to convert GIF to MP4
This GIF to MP4 converter turns animated GIFs into H.264 videos with the same frames and timing.
- Press Choose files or drop animations on “Drop GIFs here”. Each one gets a card such as “reaction.gif · 48 frames · 4.8 s · 480×270 · 8.4 MB · loops forever”.
- Check the frame count and delays on the card.
- If the GIF has see-through areas, pick a Background: White, Black or Custom.
- Set Repeat if the clip should play more than once.
- Switch on Add silent audio track only if an app insists on sound.
- Press Convert to MP4, then Download.
Several GIFs can go in one batch with the same settings, and Download all (ZIP) collects them.
Why MP4 is so much smaller than GIF
A GIF stores every frame as a separate picture of up to 256 colours. H.264 video works differently: it predicts each frame from the ones before it and keeps mostly the changes. For a typical animation, where only part of the scene moves, that difference is huge. In web.dev’s example, a 3.7 MB GIF became a 551 KB MP4.
It doesn’t always work out that way. Very small GIFs, or ones made of a few flat colours, are already compact, and the MP4 can end up larger. The page warns beforehand with “This GIF is already small — the MP4 may be bigger.”, and the result line shows the change in size either way.
| Feature | GIF | MP4 (H.264) |
|---|---|---|
| Colours | Up to 256 per frame | Millions |
| Compression | Each frame stored as its own image | Frames predicted from earlier ones |
| Transparency | Yes, one colour can be see-through | No; a background colour is filled in |
| Sound | No | Yes; here an optional silent track |
| Looping | Stored in the file | Decided by the player |
| Timing | Delay per frame, in hundredths of a second | Exact timestamp per frame |
Sources: W3C GIF89a specification; MDN Web Docs video codec guide; web.dev. Updated November 2026.
Keeping the exact frame timing
Many GIFs hold some frames longer than others: a pause on a punchline, a quick flicker, a slow fade. The card lists delays, for example “Frame delays: 0.1 s each” or “0.05–2 s, varies”, and the MP4 keeps every one of them, frame for frame, instead of forcing a fixed frame rate.
One rule comes from browsers themselves. Frames marked with a delay of zero or one hundredth of a second are shown at 0.1 s by browsers, so the MP4 does the same and notes it: “Some frames had no delay; they play at 0.1 s, as in browsers.”
Transparent GIFs: choosing a background
MP4 video has no transparency, so see-through pixels need a colour. The Background chips appear only when a GIF actually uses transparency. White is the default, Black suits dark slides and players, and Custom opens a colour picker plus a hex field, so you can type a value like #1a2b3c to match a slide or a web page exactly. The preview sits on the chosen colour before you convert.
Making a short GIF play longer
An MP4 can’t tell a player to loop. Web pages loop it with a setting, and many apps loop short clips on their own, but some players stop after one pass and some apps reject clips that are too short. Repeat builds the loops into the video itself: 1× (as is), 2×, 3×, 5× or 10×, or a minimum length of at least 5, 10, 15 or 30 seconds.
With a minimum, whole loops are added until the length is reached. A 0.6-second GIF set to “At least 5 s” becomes 9 loops lasting 5.4 seconds. The 4.8-second reaction.gif with “At least 15 s” becomes 4 loops, 19.2 seconds, and the plan shows “4 loops · 19.2 s”.
How it works
SafelyConvert decodes the GIF with gifuct-js in a background worker and draws each frame onto a canvas, filling transparent pixels with your background. The browser’s own H.264 encoder, through WebCodecs, compresses the frames, and Mediabunny (MPL-2.0) writes them into an MP4. There’s no quality slider; the bitrate follows the size, so a 480×270 GIF gets 0.72 Mbps, which turns the 8.4 MB reaction.gif into roughly 440 KB. The animation never leaves your device, and the converter keeps working offline after your first visit.
Tips & limits
- GIFs can have up to 5,000 frames and 4,096 pixels per side.
- Videos need even dimensions, so a GIF with an odd width or height is adjusted by one pixel.
- Pixel art and small coloured text may look slightly softer, because H.264 stores colour at a lower resolution than brightness.
- Animated WebP and APNG files aren’t supported.
- Dropped a video by mistake? The page points you to the Video Converter.
Frequently asked questions
Why convert a GIF to MP4?
Mainly for size and reach. An MP4 of the same animation is usually a fraction of the GIF's size, so it loads faster on web pages and in chats, and it plays in places that handle GIFs poorly, such as slide decks, video editors and upload forms that only take video. Tiny or flat-colour GIFs are the exception and can grow.
Will the MP4 loop like the GIF?
That depends on the player, not on the file. A GIF carries its own loop instruction, but an MP4 can't ask to be repeated: web pages loop it with a loop setting, and many apps loop short clips by themselves. If a player stops after one pass, use Repeat to build several loops, or a minimum length, into the video.
What happens to transparent parts?
They're filled with the background colour you choose, because MP4 video can't be transparent. White is preselected, and you can switch to Black or pick any custom colour, for instance the exact colour of your slide or web page. The preview sits on the chosen colour, so you can see the result before converting.
Does it keep the GIF's speed?
Yes, frame by frame. Each frame of the MP4 is shown for exactly as long as the same frame in the GIF, even when delays vary within one animation. The single exception follows browser behaviour: frames that the GIF marks with no delay, or just one hundredth of a second, play at 0.1 s, and the page tells you when that happens.
Can I add sound?
Only a silent track. Add silent audio track inserts an empty sound track, which helps with apps that refuse videos without sound. It can't add music or a voice-over; for that, open the finished MP4 in a video editor and lay your audio under it. The silent track adds only a little to the file size.
Will the MP4 look as sharp as the GIF?
Usually, yes, at normal viewing size. H.264 is a lossy codec, so it does throw some detail away, but GIFs are limited to 256 colours per frame and are rarely pristine to begin with. Pixel art, fine lines and small coloured text are the cases where you may notice a slight softening when you zoom in.
Can I convert GIF to MP4 on my phone?
Yes. On Android, use Chrome or Samsung Internet; Firefox for Android doesn't support the video encoder this needs. On an iPhone, Safari 16.4 or newer works, including versions before 26, because no sound has to be decoded. When the MP4 is ready, save it to Photos or Files and share it from there.
Last reviewed: