Convert AVI to GIF — Free Online Tool

Convert AVI video files to animated GIF directly in your browser — no upload required. This tool extracts the video stream from your AVI file and re-encodes it using the GIF codec, producing a looping animation with up to 256 colors per frame and full transparency support.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

AVI stores synchronized video and audio in an interleaved container, typically with H.264 or MJPEG video. During conversion to GIF, FFmpeg decodes the video frames from the AVI container and re-encodes them using the GIF codec, which maps each frame's colors to a palette of up to 256 entries. This is a full re-encode — not a remux — because GIF is a fundamentally different image-based format rather than a video codec container. All audio tracks are dropped entirely, since the GIF format has no audio channel. The output is set to loop infinitely using the -loop 0 flag, which is standard for animated GIFs intended for web use. Color depth is significantly reduced from the original AVI video (which may have 24-bit or higher color), so expect visible banding or dithering, particularly in footage with gradients or complex color scenes.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool, which handles all decoding, color conversion, palette quantization, and GIF encoding. This runs entirely in your browser via FFmpeg.wasm (WebAssembly) — the same command can be run locally on your desktop for files over 1GB.
-i input.avi Specifies the input AVI file. FFmpeg reads the interleaved audio and video streams from the AVI container; the audio will be automatically discarded since GIF has no audio channel, and the video stream is decoded for re-encoding.
-c:v gif Sets the video encoder to GIF, which re-encodes every decoded video frame from the AVI source into GIF's palette-based, LZW-compressed image format. This is a full re-encode, not a copy, because GIF uses a completely different image representation than H.264 or MJPEG.
-loop 0 Instructs the GIF encoder to embed an infinite loop flag in the output file, so the animation repeats continuously when displayed in a browser, chat app, or image viewer. A value of 0 means loop forever, which is the standard expectation for animated GIFs used on the web.
output.gif Defines the output filename and tells FFmpeg to write a GIF file. The .gif extension confirms the output container format, which stores the animated frames, palette data, and loop metadata in a single self-contained file with no audio stream.

Common Use Cases

  • Turn a short AVI clip of a product demo or software UI interaction into a looping GIF for embedding in a README file or documentation page on GitHub
  • Convert a brief AVI screen recording of a bug or error into an animated GIF to attach to a bug report or support ticket where video files are not accepted
  • Extract a memorable or funny moment from an AVI video file and convert it to a GIF for sharing on social media platforms or messaging apps that support animated GIFs natively
  • Convert a short AVI animation or motion graphic into a GIF for use as an email header or newsletter visual where video embeds are not supported
  • Turn an AVI clip of a physical product, logo animation, or loading spinner into a lightweight GIF for use in presentations or web mockups

Frequently Asked Questions

GIF is limited to a maximum of 256 colors per frame, whereas your original AVI video likely contains millions of colors encoded in H.264 or MJPEG. When FFmpeg maps the full-color video to a 256-color palette, it must approximate colors it cannot represent exactly, resulting in banding in gradients and posterization in complex scenes. Footage with smooth color transitions, skin tones, or sky backgrounds will be most affected. For better quality, keep your source clip short and consider pre-editing it to have higher contrast and simpler colors before converting.
No — the GIF format has no support for audio whatsoever, so all audio tracks from your AVI file are discarded during conversion. The FFmpeg command used here does not include any audio mapping flags because there is simply no audio channel in the GIF specification. If preserving the audio is important, consider converting to a format like MP4 or WebM instead, which support both video and audio while also being widely compatible with web browsers.
Animated GIFs are typically much larger in file size than an equivalent AVI clip, even though GIF uses lossless compression. This is counterintuitive but happens because GIF's LZW compression is far less efficient than modern video codecs like H.264, which exploit temporal redundancy between frames. A 5-second H.264 AVI that is a few megabytes can easily become a 10–30MB GIF or larger depending on resolution and motion. For web use, keep your source clip under 5–10 seconds and reduce the resolution before converting to keep the GIF file size manageable.
The output GIF is set to loop infinitely by default, controlled by the -loop 0 flag in the FFmpeg command. A value of 0 means infinite looping, which is the standard behavior expected for animated GIFs used on the web, in chat applications, and in documentation. If you want the GIF to play only once or a specific number of times, you can modify the FFmpeg command locally by changing -loop 0 to -loop 1 for one additional loop, or remove the flag entirely depending on your target platform's behavior.
To reduce file size, you can add a frame rate filter and a scale filter to the FFmpeg command. For example: ffmpeg -i input.avi -vf "fps=10,scale=480:-1:flags=lanczos" -c:v gif -loop 0 output.gif. The fps=10 reduces the frame rate to 10 frames per second (instead of the source frame rate), and scale=480:-1 resizes the output to 480 pixels wide while preserving aspect ratio. Lowering both frame rate and resolution dramatically reduces GIF file size — often by 70–90% — with acceptable visual quality for short clips.
Technically you can convert any length AVI to GIF, but it is strongly inadvisable for clips longer than 5–10 seconds. Because GIF stores every frame as a separately compressed image rather than using inter-frame video compression, file sizes grow linearly with duration and can reach hundreds of megabytes for longer clips. If you need to convert a specific segment of a longer AVI, add the -ss (start time) and -t (duration) flags to the FFmpeg command: ffmpeg -ss 00:00:05 -i input.avi -t 00:00:06 -c:v gif -loop 0 output.gif. This example starts at the 5-second mark and captures 6 seconds of footage.

Technical Notes

The GIF format was designed in 1987 and uses a palette-based color model where each frame is limited to 256 colors drawn from the 24-bit RGB color space. When converting from AVI — which typically carries H.264 (libx264) or MJPEG video with full 24-bit color — FFmpeg must perform color quantization, reducing the millions of available colors in each frame to 256. The default palette generation in a basic FFmpeg GIF conversion uses a global palette computed across frames, which can produce suboptimal results for footage with diverse color scenes. For significantly better output quality, a two-pass palettegen/paletteuse filter approach is recommended when running FFmpeg locally. The AVI container's multiple audio track support is irrelevant here since GIF carries no audio. Transparency is technically supported in the GIF output (GIF supports one transparent color index per frame), but the basic conversion command does not enable keying or transparency mapping from the source video. The GIF codec in FFmpeg uses LZW lossless compression per frame, so within its 256-color constraint the output is lossless — there is no quality parameter to tune, unlike H.264 CRF-based encoding. File sizes should be carefully managed by controlling output resolution and frame rate before conversion.

Related Tools