Guide
Turning GIFs into MP4 or WebM video in the browser
Social networks, messaging apps and presentation software increasingly prefer video to GIF. A short MP4 is usually a fraction of the size of the same animation as GIF, has millions of colors instead of 256, and can be posted where GIFs are not accepted at all. This tool converts GIFs, and animated WebP files, into MP4 or WebM using the video encoder built into your browser.
Why video beats GIF for animations
Video codecs such as H.264 and VP9 store mostly the differences between frames and are designed for photographic motion. A screen recording or a clip that weighs 8 MB as GIF commonly fits in a few hundred kilobytes as MP4 while looking smoother. Platforms like Instagram and TikTok accept video uploads directly, and Twitter/X converts GIFs to video on upload anyway.
How the encoding works
WebCodecs gives web pages access to the computer’s or phone’s own video encoder, often hardware-accelerated. The tool draws each GIF frame onto a canvas, hands it to the encoder with its exact timestamp and duration, and packs the encoded stream into an MP4 or WebM container. It tries several H.264 profiles and picks the best one your browser supports at the clip’s size, so the file plays widely.
Timing stays exact
GIF frames can each have their own delay; a hold on a key frame might last a second while other frames flash by. The video keeps those durations frame by frame instead of forcing a fixed frame rate, so the rhythm of the animation is preserved. The speed control scales all durations at once.
Repeats and minimum lengths
A video file does not loop on its own; looping is a setting of the player or app. Many platforms loop short videos automatically, but some require a minimum length. “Play the animation” repeats the sequence inside the file between 1 and 50 times, which is also handy for presentations, where a loop of a few seconds might end too soon.
Transparency and size
Video formats used here have no transparency. Transparent areas of the GIF are filled with the background color you choose, white by default; pick the color of the page or slide where the video will appear. Video encoders also require even pixel dimensions, so a 301-pixel-wide GIF becomes 300 pixels wide, an invisible change. The optional width limit scales large GIFs down for lighter files.
Browser requirements
WebCodecs is available in current Chrome, Edge and Safari on computers and phones, and in Firefox on computers. If your browser lacks it, the page says so before you start. Encoding happens on your device; the GIF is never uploaded.
Checking the result
The video appears next to the original GIF with both file sizes, playing in a loop so you can compare smoothness and colors. Download it and test it in the app where it will be used; MP4 with H.264 is the safe choice for broad compatibility.
Related tools
For an animated image instead of a video, GIF to WebP keeps the animation in an img-compatible format. To create a GIF first from photos, use GIF Maker; to cut a video into a GIF, see Video to GIF.
Checked against the current version of the GIF to MP4 on .

