GIF to MP4
Published Updated
Record an animated GIF as an MP4 video, or a WebM where the browser cannot write MP4, with 1, 3, 5 or 10 loops at the quality you pick.
Loops, time and size for a 3-second GIF
The recording is real time, so duration is the GIF's length times the loops, capped at 30 seconds. Sizes are the targets for each quality, not guarantees.
| Loops | Video length | High (6 Mbps) | Medium (2.5 Mbps) | Low (0.8 Mbps) |
|---|---|---|---|---|
| 1 | 3 s | 2.25 MB | 0.94 MB | 0.30 MB |
| 3 | 9 s | 6.75 MB | 2.81 MB | 0.90 MB |
| 5 | 15 s | 11.25 MB | 4.69 MB | 1.50 MB |
| 10 | 30 s | 22.50 MB | 9.38 MB | 3.00 MB |
How timing is handled
The tool decodes your GIF into frames with their delays, then paints them on the canvas one at a time.
- A frame delay below 20 ms is raised to 20 ms, and a delay of 0 in the file is read as 100 ms.
- The canvas is captured at 24 frames per second, so a very fast GIF can lose frames.
- Output size equals the GIF's pixel size. Nothing is scaled.
- Limits come from the GIF reader: 1,000 frames and 10,000 pixels per side.
Turning a GIF into a video
Step 1
Add an animated GIF
Pick one GIF. The preview and its size show that the file was read and passed the frame and dimension checks.
Step 2
Pick loops and quality
Choose 1, 3, 5 or 10 loops, and High, Medium or Low quality.
Step 3
Convert and download
The animation plays on a hidden canvas while it is recorded. The result is an MP4, or a WebM in browsers that cannot write MP4.
When to keep the GIF
A GIF can repeat forever inside an image tag and works in places that refuse video. A video is not always smaller than its GIF: in the measurements further down it was smaller for the flat-art GIF at every quality, but at High and Medium quality it was larger than the busy GIF in WebKit and Firefox. Here the video is made by your browser's own recorder. Recording uses the MediaRecorder API, and frame delays are defined in hundredths of a second by the GIF89a specification.
To make the GIF itself smaller, try GIF Compressor. For the opposite conversion, use Video to GIF.
What three browsers did with the same 3-second GIFs
We generated two 480 x 270 GIFs of 30 frames at 100 ms each with the site's GIF encoder: flat art (a disc moving over a flat background) and a busy one (a color-shifting gradient with 400 random rectangles per frame). Then we ran the tool's own decode and recording code, with 1 loop, at each quality, in Chromium 153.0.8010.12 (the build that ships with Playwright, headless, not Google Chrome), Firefox 155.0 and Playwright's WebKit build (user agent Version/26.6, not the Safari app). The encoders produce slightly different GIFs per engine, 37.6 to 38.1 KB for the flat one and 773 to 860 KB for the busy one.
| Engine | Container the tool chose | Flat art, High / Medium / Low | Busy, High / Medium / Low |
|---|---|---|---|
| Chromium 153 | MP4 (avc1) | 27,197 / 27,197 / 26,579 B | 375,863 / 256,353 / 221,873 B |
| WebKit 26.6 | MP4 (avc1) | 24,283 / 24,244 / 22,428 B | 1,040,454 / 939,211 / 310,123 B |
| Firefox 155 | WebM (VP8) | 22,415 / 22,398 / 20,482 B | 1,095,409 / 993,153 / 341,576 B |
Firefox reported that it cannot record MP4 at all, so the tool wrote WebM there. In Firefox 155 the result card said WEBM, the download button read Download WEBM Video and an amber notice said the browser can only record WebM. Every file opened in a video element at the right size. The targets in the first table on this page (2.25, 0.94 and 0.30 MB for 3 seconds) are ceilings. The busy GIF reached about half of the High ceiling in WebKit and Firefox, at 1.04 and 1.10 MB, and the flat GIF stayed between 20 and 27 KB at every quality. In Chromium the High and Medium files of the flat GIF were the same size to the byte, so the step from High to Medium changed nothing for that GIF.
The length followed the clock. A 3.0-second GIF at 1 loop gave videos of 2.99 to 3.01 s in Chromium, 3.08 to 3.09 s in WebKit and 3.12 to 3.18 s in Firefox when read back by a video element, and recording took 3.06 to 3.20 s. At 3 loops the flat GIF gave 9.14, 9.33 and 9.49 s from 9.0 s of animation, with files of 83,055, 70,669 and 66,901 bytes. So expect a video within a fraction of a second of loops times the GIF length.
GIF to MP4 questions
Why does conversion take as long as my GIF plays?
The video is recorded live while the animation runs on a canvas. A 3-second GIF at 3 loops needs about 9 seconds, and the progress bar follows that clock.
Why does my long GIF end before the last loop?
Recording stops after 30 seconds. A 4-second GIF set to 10 loops would run for 40 seconds, so the video ends after about 7 and a half loops.
Can the MP4 loop forever?
No, it plays the number of loops you chose and stops. For a web page, convert with 1 loop and add the loop attribute to the HTML video tag, which repeats it without making the file longer.
What do High, Medium and Low change?
They set the video bitrate to 6, 2.5 and 0.8 megabits per second. For a 9-second clip that is up to about 6.8 MB, 2.8 MB and 0.9 MB. Flat artwork usually lands below those targets.
Why did I get a WebM instead of an MP4?
Your browser cannot record MP4, so the tool fell back to WebM. The result card and the download button say so, and an amber notice explains it. WebM plays in browsers and many apps but not everywhere MP4 does.
Why are transparent areas of my GIF black?
Video has no alpha channel. The recording is made from a canvas, and transparent pixels are not composited onto a background, so the transparent area of our test GIF came out black in Chromium 153, Firefox 155 and the WebKit build. Add a solid background to the GIF first.
Which browsers give a real MP4?
Chromium 153 and the WebKit build recorded MP4 with H.264, and Firefox 155 reported no MP4 recording and gave WebM. The result card shows what your browser wrote.
Why is my video so much smaller than the size in your table?
The table gives the most the chosen bitrate allows. Our flat-art test GIF came out at 20 to 27 KB for 3 seconds at every quality, and a busy GIF reached about half of the High ceiling in WebKit and Firefox.
Will the video be as long as my GIF times the loops?
Close to it. For a 3.0-second GIF at 1 loop we measured 2.99 to 3.18 seconds, and for 3 loops 9.14 to 9.49 seconds, depending on the browser.
Related guides
Making a GIF from a video: size, frame rate and quality. The guide compares a GIF with the same loop as MP4 or WebM, and works out the size of a short loop at common bitrates.
MP4, MOV and WebM: which video format to use and how to convert. The guide runs a 10 fps GIF back through the tool: 134,354 to 212,943 bytes against GIFs of 244,614 to 276,073 bytes.