Free Converter

GIF to MP4 Converter

Convert GIF animations to MP4 (H.264) video files instantly inside your browser securely.

Click or drag GIF here

Supports up to 50MB

Or
Loading video encoder core...

About GIF to MP4 Conversion

GIF is a 1987 image format that gained second life as the default looping animation format on the web. It works, but not efficiently — GIF tops out at 256 colors per frame, uses inefficient LZW compression, and produces files several times larger than equivalent video. A 5-second animated GIF at 480×270 typically weighs 2–4 MB; the equivalent MP4 video is usually 200–500 KB at the same visual quality. For sites that serve animated content, switching from GIF to MP4 routinely reduces bandwidth by 80% or more.

This converter uses FFmpeg compiled to WebAssembly via the @ffmpeg/ffmpeg library. FFmpeg parses the GIF, decodes each frame, and re-encodes the frame sequence as H.264 video in an MP4 container. The conversion happens entirely in your browser — no server upload — but uses several megabytes of WebAssembly code that loads on first use, which means the first conversion takes a moment to initialize.

Frame timing from the GIF is preserved as accurately as MP4 allows. GIF supports per-frame delays measured in 1/100ths of a second; MP4 expresses timing as a frame rate. Most GIFs use a constant or near-constant frame delay, which converts cleanly to a fixed video frame rate. GIFs with highly variable timing may produce video that runs slightly faster or slower in places.

Why Convert GIF to MP4

Bandwidth is the headline reason. Twitter, Reddit, and many other platforms have been converting user-uploaded GIFs to MP4 internally for years precisely because the size savings are dramatic. If you embed animated content on your own site, switching to MP4 with autoplay-loop-muted attributes produces the same visual experience as a GIF at a fraction of the file size and with smoother playback.

Quality also tends to be better. GIF's 256-color palette per frame produces visible banding on photographic content, while H.264 video preserves smooth gradients with no apparent palette limitation. For animations involving photos, screencasts, or 3D renders, MP4 looks markedly better than GIF at any file size.

How to Convert GIF to MP4

Drop the GIF, wait for FFmpeg to load the first time, get an MP4.

  1. Upload your GIF: Drag the file into the upload area or click to browse. Files up to 50 MB are supported. The first conversion in a session loads the FFmpeg WebAssembly module — typically a few megabytes — which takes a moment over slow connections.
  2. Choose output settings (optional): Default settings produce H.264-encoded MP4 at the source GIF's frame rate and dimensions, with preset 'fast' encoding. Adjustments are available for output resolution and quality if needed.
  3. Convert: FFmpeg parses the GIF, decodes the frame sequence, and re-encodes as H.264 in an MP4 container. Progress is shown as the encoder works through frames. Conversion typically takes a few seconds for short GIFs and longer for high-frame-count or high-resolution sources.
  4. Download the MP4: Save the file. To embed on a webpage with GIF-like behavior, use a video tag with autoplay, loop, muted, and playsinline attributes.

Common Use Cases

Technical Details

GIF (CompuServe, 1987) uses LZW compression on indexed color frames with up to 256 colors each. Animation is stored as a sequence of frames with per-frame delays in centiseconds. Transparency is supported via a single transparent palette index; partial transparency is not.

H.264 (ITU-T H.264, ISO/IEC 14496-10) encodes video using inter-frame prediction (key frames plus differences), discrete cosine transforms, and CABAC or CAVLC entropy coding. The H.264 codec running inside an MP4 container is universally supported by browsers, mobile devices, and video tools.

@ffmpeg/ffmpeg is FFmpeg compiled to WebAssembly. The WASM module is several megabytes and loads on first use; subsequent conversions in the same session reuse the loaded module. Encoding is single-threaded in current browsers without SharedArrayBuffer, which makes WebAssembly-based encoding noticeably slower than native FFmpeg but still fast enough for typical GIF sizes.

Best Practices

Frequently Asked Questions

How much smaller will my MP4 be?
Typically 70–90% smaller than the source GIF for the same visual content. Actual savings depend on the GIF: highly varied content with many colors compresses better as MP4 than simple two-color animations, but in essentially all cases MP4 is dramatically smaller.
Will the animation loop in MP4?
MP4 itself does not contain looping metadata, but the video tag's loop attribute makes the video repeat indefinitely on a webpage. Use video autoplay loop muted playsinline to reproduce GIF-like looping behavior.
Why does the first conversion take longer?
FFmpeg is compiled to WebAssembly and loads on first use. The module is several megabytes; download and initialization can take a few seconds the first time. Subsequent conversions in the same session reuse the loaded module and are faster.
Is my GIF uploaded to a server?
No. FFmpeg runs as WebAssembly entirely in your browser. The GIF and the resulting MP4 never leave your device.
Will transparency be preserved?
No. MP4 does not support transparency. Transparent areas in the GIF are flattened against a solid background (typically black) during encoding. For transparent video, use a different format such as WebM with VP9 alpha or APNG.
What is the maximum file size?
50 MB. The practical limit also depends on browser memory, since FFmpeg keeps decoded frames in memory during conversion.
Will the frame rate match the GIF exactly?
Close, but not always exact. GIFs use per-frame delays in 1/100 seconds; MP4 typically uses a fixed frame rate. Constant-delay GIFs convert cleanly. GIFs with widely varying delays may show slight timing differences after conversion.
Can I convert MP4 back to GIF?
Yes — use the dedicated MP4 to GIF tool, which runs the same FFmpeg pipeline in reverse. Note that converting back loses quality due to GIF's 256-color limit.