Convert GIF to MP4 Online
Convert animated GIFs to MP4 video. Up to 90% smaller, with better color quality. Free, in your browser.
.gif · up to 100 MB
What you can do
GIF to MP4: smaller, sharper animations
Up to 90% smaller
H.264 compresses animation far better than GIF's LZW algorithm. Same content, a fraction of the size.
100% private
Conversion happens in your browser. Your GIF is never uploaded to any server.
Universal compatibility
MP4/H.264 works in all browsers, social networks, and messaging apps.
Instant
No queues or waiting. The GIF converts in seconds directly on your device.
How it works
Three steps, no hassle
Upload your animated GIF
Drag or select your .gif file. Maximum size depends on available device memory; files up to 50 MB process without issue in most modern browsers.
Automatic conversion to MP4
The GIF converts to MP4 video (H.264) in your browser using WebCodecs or Canvas API. The full animation is preserved with all its frames.
Download the MP4
Compare the original GIF size with the new MP4. Typical savings are 70–90%. Download and use it on any platform.
FAQ
Got questions?
The GIF (Graphics Interchange Format) was developed by CompuServe in 1987 using the LZW (Lempel-Ziv-Welch) compression algorithm, patented by Unisys. The last Unisys patents on LZW expired in 2004, fully freeing the format. GIF has two fundamental technical limitations: it only supports 256 colors per frame (8-bit palette), which produces visible color banding in gradients and photographs; and its LZW compression algorithm is not optimized for video, resulting in files much larger than modern video formats for the same animated content. MP4 with H.264 (AVC) codec uses inter-frame compression (P-frames and B-frames that store only the differences between frames) and support for millions of colors (4:2:0 chroma subsampling with 16.7 million colors), producing files 70–95% smaller than the equivalent GIF with significantly superior visual quality.
Yes, GIF to MP4 conversion preserves all frames of the original animation and the duration timing of each frame. GIF stores each frame's duration in hundredths of a second (10 ms resolution), with a minimum value of 2 hundredths (20 ms, equivalent to 50 fps). Browsers have historically interpreted values of 0 or 1 hundredth as 10 hundredths (100 ms, 10 fps) to avoid overly fast animations. The resulting MP4 uses a framerate that preserves the GIF's original timings. If the original GIF has frames with variable durations (which is common), the MP4 uses a high framerate (typically 100 fps) with duplicated frames to faithfully represent each duration.
The size reduction when converting GIF to MP4 is generally very significant, between 70% and 95%. The exact factor depends on content: animations with a lot of motion and many colors (like video clips converted to GIF) benefit most from H.264's inter-frame compression. A 10 MB animated GIF with a 10-second clip typically converts to a 0.5–1.5 MB MP4. Simple animations with few colors and limited motion (like animated logos or icons) may have smaller reductions (50–70%) because GIF's LZW algorithm is already relatively efficient for that type of content. Color depth is an important factor: a GIF uses 256 colors per palette while MP4/H.264 uses YCbCr 4:2:0 with 8 bits per channel, representing millions of colors with less visual artifact.
Yes. The HTML5 <video> element with autoplay, loop, and muted plays MP4 (H.264) natively in all modern browsers without JavaScript. Chrome 4+ (2010), Firefox 35+ (2015), Safari 3.1+ (2008), Edge, and Opera support native H.264/MP4 in the <video> element. The combination <video autoplay loop muted playsinline> is the modern equivalent of the <img> tag with a GIF: plays the animation automatically, in a loop, without sound, without controls, and on iOS without requiring user interaction (the playsinline attribute prevents iOS from playing in full screen). Twitter, Giphy, Imgur, and most social media platforms internally convert all uploaded GIFs to MP4 or WebM to serve them as video, significantly improving their page load performance.
The visual quality difference is substantial. GIF has a 256-color palette per frame (8 bits per pixel), which produces visible dithering in images with smooth gradients, photographs, or any content with more than 256 distinct tones. Dithering is the process of approximating colors not available in the palette through patterns of adjacent colored dots (algorithms like Floyd-Steinberg, 1976). The visual result is noise patterns characteristic of the GIF format, especially visible in uniform color areas and gradients. MP4/H.264 works in YCbCr color space with 8 bits per channel (approximately 16.7 million colors) and the only visual artifact at moderate bitrates is macroblock blocking (8x8 or 16x16 pixels) visible in very aggressive compression, which at bitrates of 500 kbps or higher is completely invisible.
Yes, with some platform-specific considerations. Twitter/X accepts MP4 up to 512 MB and 140 seconds; uploaded GIFs are internally converted to MP4 and served as muted looping video. Instagram accepts MP4 up to 650 MB for Reels and Stories. WhatsApp accepts MP4 up to 16 MB for videos (applies internal compression if the file is larger). Telegram accepts MP4 up to 2 GB. Discord accepts MP4 up to 8 MB on free accounts. For use on web pages, the <video autoplay loop muted playsinline> element with the MP4 as source is the technique recommended by Google PageSpeed Insights and Core Web Vitals to replace animated GIFs: it improves LCP (Largest Contentful Paint) and reduces user bandwidth consumption. Giphy serves its GIFs internally in WebM format (for Chrome/Firefox) and MP4 (for Safari) using the <video> element, never the original <img> tag.
Convert GIF to MP4: history, technical details, and web performance
The GIF (Graphics Interchange Format) was created by CompuServe on June 15, 1987, designed by engineer Steve Wilhite to transmit color images over slow modem connections. GIF uses the LZW (Lempel-Ziv-Welch) compression algorithm, developed by Abraham Lempel and Jakob Ziv in 1977 and refined by Terry Welch in 1984, which Unisys patented in the United States in 1985. This patent caused significant controversy in the 1990s when Unisys began charging licensing fees to software developers. The last Unisys patents on LZW expired in 2004, fully freeing the format. GIF has supported animations since its second version, GIF89a (1989), which introduced graphic control extension blocks that allow specifying each frame's duration and loop behavior. The most significant technical limitation of GIF for modern animations is its 8-bit color palette: only 256 colors per frame. This restriction was acceptable in 1987 when typical computer monitors displayed 16 or 256 colors, but is completely inadequate for photographs, video clips, and modern graphics. The PNG format (Portable Network Graphics), created in 1996 precisely as a patent-free alternative to GIF, resolved the color limitations but does not support animations in its standard version (APNG is an unofficial extension, though well-supported since 2017 in Chrome and Firefox). Google's WebP format (2010) supports animations with a full color palette and better compression than GIF.
Web performance is the strongest argument for replacing GIFs with MP4 or WebM video. Animated GIFs are notoriously inefficient for webpage loading for several technical reasons: they are images, not videos, so they do not benefit from the browser's video streaming optimizations (adaptive preloading, buffering); they download completely before playback begins; and the LZW algorithm produces significantly larger files than modern video codecs for the same content. Google PageSpeed Insights and Google's Core Web Vitals explicitly recommend replacing animated GIFs with HTML5 video as one of the highest-impact optimizations for LCP (Largest Contentful Paint), one of the three Web Vitals factors that influence SEO ranking since May 2021. The adoption of MP4 as a GIF replacement on social platforms began around 2014–2015. Twitter was one of the first to implement it: in June 2014, Twitter announced native support for animated GIFs, but internally converts them to MP4 from the start to serve them as muted looping video. Giphy, the world's largest GIF database (founded in 2013), serves its content in MP4 and WebM formats to compatible browsers, using the <img> tag only as a fallback. Imgur implemented the same conversion with its GIFV format in October 2014. This transition was driven by bandwidth cost reduction: a 5 MB GIF typically converts to a 0.3–0.5 MB MP4, a 90–94% reduction that translates directly into lower CDN costs.
From a web developer perspective, the correct pattern for replacing GIFs with video is the <video> element with the autoplay, loop, muted, and playsinline attributes. The muted attribute is technically required by browsers to allow autoplay (Chrome 66+, Firefox 66+, Safari 11+ block autoplay of video with audio); playsinline is necessary on iOS to prevent the video from opening in full screen. For maximum compatibility, two sources are served: WebM/VP9 for Chrome and Firefox (better compression) and MP4/H.264 as a fallback for Safari and older browsers. The W3C specification for the <video> element is defined in HTML5 (published as a recommendation in October 2014) and is part of the HTML Living Standard maintained by WHATWG. For production use cases, command-line tools offer more control. FFmpeg converts GIF to MP4 with: ffmpeg -i input.gif -vf 'fps=15,scale=640:-1:flags=lanczos' -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4. The -movflags +faststart flag moves the moov atom to the beginning of the MP4 file (a technique known as MP4 fast start or progressive download), allowing the video to start playing before it has fully downloaded. The fps=15 filter reduces the framerate for smaller files (many original GIFs have 10–15 fps anyway). The scale=640:-1 filter limits the width to 640 pixels while maintaining the aspect ratio, significantly reducing size for high-resolution GIFs.