How to Convert WebM to GIF
Two dependable methods: a private converter that runs in your browser, and a one-line FFmpeg command for the terminal.
Method 1: in your browser (no install, no upload)
- Open the WebM to GIF converter and choose your .webm file. It loads locally; nothing is uploaded.
- Play the preview and set the start and end of the clip you want, using Use current or by typing times.
- Choose a width (480 px is a good start), a frame rate (10–15 fps) and the number of colors (256 for best quality).
- Press Convert to GIF. A progress bar shows each frame being processed; you can cancel at any time.
- Check the preview and the file size, then press Download.
This works on any device with a modern browser, including phones, as long as the browser can play the WebM. It also handles WebM files that don’t record their duration, which some browser recordings don’t.
Method 2: FFmpeg on the command line
If you have FFmpeg installed, this command converts four seconds of a WebM, starting at two seconds, into a looping 480 px GIF at 12 fps with a palette generated from the clip:
ffmpeg -ss 2 -t 4 -i input.webm \
-vf "fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" \
-loop 0 output.gif| Part | What it does |
|---|---|
-ss 2 | Before -i: seek the input to 2 seconds. |
-t 4 | Before -i: read only 4 seconds of the input. |
fps=12 | Convert to a constant 12 frames per second by dropping or duplicating frames. |
scale=480:-1:flags=lanczos | Resize to 480 px wide; -1 keeps the aspect ratio; Lanczos resampling. |
split[a][b] | Send the video to two branches: one to build the palette, one to be encoded. |
palettegen | Generate one palette for the whole clip. |
paletteuse | Map every frame to that palette. |
-loop 0 | GIF muxer option: loop forever (use -1 for no loop). |
The option descriptions above follow the official FFmpeg documentation for the palettegen, paletteuse, scale and fps filters, the GIF muxer and the ffmpeg command.
Which method should you use?
| Browser converter | FFmpeg | |
|---|---|---|
| Install needed | No | Yes |
| Works on a phone | Yes, if the browser plays the file | Not easily |
| Visual trimming | Yes, with a preview player | By typing times |
| Batch conversion of many files | One at a time | Yes, with a script |
| Files stay on your device | Yes | Yes |
What is a WebM file?
WebM is an open, royalty-free media file format designed for the web. A WebM file holds video compressed with VP8 or VP9 and audio compressed with Vorbis or Opus, in a container based on Matroska (WebM can also carry AV1 video). GIF, by contrast, is an image format: it has no audio, each frame uses a palette of up to 256 colors, and frame timing is stored in hundredths of a second. That is why a GIF of the same clip is usually larger and less colorful than the WebM, and why keeping the clip short matters.
Frequently asked questions
What's the easiest way to convert WebM to GIF?
Use a browser-based converter like the one on this site's home page: open the WebM, trim it, choose the size and download the GIF. No install and no upload.
Why use palettegen and paletteuse in FFmpeg?
They generate a color palette tailored to your video and then apply it, instead of using a generic palette. The FFmpeg documentation describes palettegen as generating one palette for a whole video stream, and paletteuse as using a palette to downsample the video.
How do I make the FFmpeg GIF play only once?
Set -loop -1 on the output. According to the FFmpeg documentation for the GIF muxer, -1 means no loop and 0 (the default) loops indefinitely.
Can I convert WebM to GIF without losing quality?
Not entirely: a GIF frame is limited to 256 colors and the file is usually larger than the video. You can keep quality high with 256 colors and a sensible width, and reduce the frame rate rather than the colors to save space.