GIF to MP4 Converter
Convert GIF to MP4 video instantly in your browser. No upload, no server. Parses GIF frames natively and encodes to MP4/WebM with original timing.
About
Animated GIF files use LZW compression with per-frame delay tables stored in Graphics Control Extension blocks. A typical GIF carries 256-color palette per frame, no audio track, and frame delays quantized to 10ms increments. The format produces files 5× to 20× larger than equivalent H.264/VP9 video at comparable visual quality. Sharing GIFs on platforms that transcode to video (Twitter, Telegram, iMessage) triggers server-side re-encoding that degrades quality unpredictably. Converting beforehand gives you control over output parameters.
This tool parses the raw GIF binary in your browser - reading the Logical Screen Descriptor, decoding each LZW-compressed frame with proper disposal method handling (restoreToBackground, restoreToPrevious, doNotDispose), reconstructing the full-resolution canvas state per frame, then encoding the sequence into a video container using the browser's native MediaRecorder API. No data leaves your device. Limitation: output codec depends on browser support - Chromium produces WebM (VP8/VP9), Safari produces MP4 (H.264). Frame timing accuracy is ±10ms due to GIF spec granularity.
Formulas
GIF frame delay is stored as a 16-bit unsigned integer in units of 1/100 second:
tframe = delay × 10 ms
Effective framerate:
fps = 1000tframe
Many GIF encoders use a delay value of 0 (undefined). Browsers interpret this as approximately 100ms (10fps). This converter follows the same convention.
Estimated compression ratio for video output:
R = SgifSvideo ≈ 5 - 20×
Where Sgif = GIF file size in bytes, Svideo = output video file size. Actual ratio depends on frame complexity, motion amount, and color distribution.
LZW decompression initializes a code table of size 2minCodeSize + 2 entries (clear code and EOI code), then builds dictionary entries dynamically as compressed codes are read from the sub-block stream.
Reference Data
| Property | GIF | MP4 (H.264) | WebM (VP9) |
|---|---|---|---|
| Max Colors | 256 per frame | 16.7M (8-bit 4:2:0) | 16.7M (8-bit 4:2:0) |
| Compression | LZW (lossless per frame) | DCT + Motion Compensation | DCT + Motion Compensation |
| Transparency | 1-bit (on/off) | Not supported | Alpha channel (VP9) |
| Audio | None | AAC, MP3 | Opus, Vorbis |
| Typical File Size (5s, 480p) | 2 - 15MB | 0.2 - 1.5MB | 0.15 - 1.2MB |
| Min Frame Delay | 10ms (100fps max) | Arbitrary | Arbitrary |
| Browser Decode | Native <img> | Native <video> | Native <video> |
| Looping | Netscape App Extension block | Player-dependent | Player-dependent |
| Interlacing | Supported (4-pass) | N/A | N/A |
| Max Dimensions | 65535 × 65535 | Codec-limited (~8192p) | Codec-limited (~8192p) |
| Disposal Methods | 4 (none, background, previous, unspecified) | N/A (full frames) | N/A (full frames) |
| Container Format | .gif | .mp4 (ISOBMFF) | .webm (Matroska) |
| Patent Status | Expired (2004) | Licensed (MPEG LA) | Royalty-free |
| Year Introduced | 1987 | 2003 | 2010 |