OfflaneAI

GIF to MP4 —
tiny video from any animated GIF

Drop a GIF, choose MP4 or WebM, repeat it to reach the minimum length a platform needs, download. The original frame timing is kept exactly.

  • 📉 Up to 50× smaller than the GIF
  • 🔁 Loop to 3 s, 5 s, 10 s…
  • 🔒 Converted on your device
  • 💸 Free, no watermark

Loading the tool… (JavaScript required)

Why convert a GIF to MP4?

GIF is a 1989 format with 256 colours and no real compression; a 5-second clip can be 20 MB. The same animation as MP4 is often under 500 KB, looks smoother and is required by Instagram, TikTok and most messengers, which do not accept GIF uploads.

Why does Instagram reject my converted video?

Instagram needs at least 3 seconds. Set “Minimum length” to 3 s (or 5 s for Reels) and the GIF is looped until it reaches that length. The output also uses an even width and height and H.264, which every platform accepts.

Will transparent GIFs work?

Video has no transparency, so transparent areas are filled with the background colour you pick — white by default, or black, or your brand colour.

How to convert a GIF to a video

  1. Add the GIF. Drop an animated GIF on the upload area. The line under it shows the pixel size, the number of frames, the length in seconds and the file size.
  2. Choose the Format. MP4 is selected to begin with; WebM is the alternative.
  3. Set the length. “Repeat” plays the animation 1 to 10 times in a row. “Minimum length” repeats it until the video lasts at least 3, 5, 10 or 15 seconds. If you set both, the larger number of repeats is used.
  4. Pick a Background if the GIF has transparent areas. White is the default.
  5. Resize if needed. “Keep original size” is the default; the other choices limit the longer side to 1080, 720 or 480 px.
  6. Press “Convert to MP4” or “Convert to WEBM”. The result plays in a loop next to a download button that shows the new size and the saving compared with the GIF.

What happens during the conversion

Frames are rebuilt in full

Many GIFs store only the rectangle that changed in each frame, with a rule for what happens to the previous picture: keep it, clear the area, or go back to the earlier state. The converter follows these rules and builds the complete picture for every frame, so optimised GIFs come out without trails or missing parts.

Timing is taken from the GIF

Every frame stays on screen for the delay stored with it, including GIFs where the delays differ from frame to frame. Two corrections are applied: a delay of 0 becomes 0.1 second, and anything shorter than 0.02 second is raised to 0.02.

The video gets a fixed bitrate

The bitrate depends only on the frame size. A GIF up to roughly 640×360 or 500×500 px is encoded at about 0.67 Mbit/s, which is about 85 KB for each second of video. Larger frames get more, up to 5.6 Mbit/s at 1920×1080. A GIF that needs megabytes for 5 seconds therefore becomes a file of roughly 400 KB.

Width and height are rounded to even numbers, as video encoders require, and the file has no audio track.

MP4 or WebM

MP4WebM
Video codecH.264VP9
Plays onPhones, computers, TVs and every social platformChrome, Firefox, Edge, Android, Discord and web pages
Choose it forInstagram, WhatsApp, iPhone, presentationsWebsites and communities that prefer open formats

Both formats receive the same bitrate here, so expect files of similar size. VP9 uses those bits more efficiently, which shows as slightly cleaner edges, not as a smaller file. When unsure, take MP4.

Length, background and size

Repeat and Minimum length

A GIF carries an instruction to loop forever. A video file does not: it plays once, and looping is up to the app that shows it. The two length controls write the repeats into the video itself.

  • Repeat is for a fixed number of loops, for example 3× for a slide that should play a short animation a few times.
  • Minimum length is for platforms that refuse very short clips. A 1.2-second GIF with a 5-second minimum is played 5 times and lasts 6 seconds.

Only whole loops are added, so the video always ends at the loop point and restarts cleanly in players that loop. The file size grows with every repeat.

Background

Transparent pixels are painted with one colour. Match the place where the video will be shown: white for documents and light pages, black or dark grey for dark themes, the exact colour of your site for a sticker-like effect.

Resize

The setting only reduces. A 400 px GIF stays 400 px at every choice, and no setting enlarges a small GIF. Reducing a large GIF to 480 px also lowers the bitrate and the file size.

Settings by destination

DestinationFormatLengthNotes
Instagram post or ReelMP4Minimum length 3 s or 5 sInstagram does not take GIF uploads
WhatsApp, Telegram, iMessageMP4No minimumSends as a small video
DiscordMP4 or WebMNo minimumBoth play in the chat
WebsiteWebM, with an MP4 copy for older SafariNo minimumSee below
PresentationMP4Repeat 2–5×Or switch on looping in the slide app

Replacing a GIF on a web page

Put the file in a video element with the attributes autoplay, loop, muted and playsinline. It then behaves like the GIF did: it starts by itself, repeats and shows no controls. Converting twice, once per format, lets you list WebM first and MP4 as the fallback.

After the conversion

The result is an ordinary video, so the video tools apply to it. Cut a few frames from the start or end with the video trimmer, remove empty margins with the video cropper, or slow the animation down with the video speed changer. For the opposite direction, the video to GIF converter makes a GIF from any clip.

Limits worth knowing

  • Quality cannot exceed the GIF. The 256 colours and the dot patterns of the original are kept as they are; video does not bring the lost colours back.
  • No transparency. The chosen background becomes part of the picture.
  • No sound. There is no option to add music or a voice.
  • Small GIFs may not shrink. Because of the bitrate floor, a tiny, short or already well-optimised GIF can come out the same size or larger. The saving is then shown as −0%.
  • GIF only. Animated WebP and APNG files are not accepted.
  • Memory. The whole GIF is unpacked in memory, so files of several hundred megabytes can fail on a phone.

How it runs on your device

The GIF is unpacked by gifuct-js, an open-source library under the MIT licence, and each rebuilt frame is passed to the video encoder of your device through WebCodecs. No AI model is involved and nothing is downloaded beyond the page. The GIF is read from your disk and the video is created in the same tab, so a private chat sticker or an internal screen capture is never transmitted. You need Chrome, Edge, Opera or Safari 17 and later.

Troubleshooting

“This does not look like a valid GIF file”

The file is not a GIF inside. Many sites deliver their “GIFs” as WebP images or MP4 videos, and saving them keeps the wrong name. If it is already a video, the video converter can change its format directly.

“No supported video encoder in this browser”

This browser cannot encode the chosen format, which can happen with WebM in Safari. Switch Format to MP4 or use Chrome or Edge.

The video plays once and stops

That is how video works. Raise “Repeat”, or turn on looping in the app or player that shows it.

There is a white box around the animation

The GIF was transparent. Choose a Background that matches the page or chat where the video will appear and convert again.

The video runs faster than the GIF did in my browser

The GIF stores a delay of 0.01 second per frame. Browsers slow such GIFs down to 0.1 second; the converter uses 0.02. Bring the result back to the pace you expect with the video speed changer.