Cookies for analytics and advertising
We use cookies for analytics and advertising, both sent to Google. Refusing changes nothing you can see.Read the privacy page
Converting GIF to WebM produces the smallest file that will replace the animation on a page you control: VP9 video in a container built for the web. In our testing a 448 KB GIF became a 19 KB WebM, playing identically. The conversion runs in your browser.
Up to 100 files at once. Mixed formats are fine.
They convert one after another and download together as a ZIP.
GIF to WebM
The reason to choose WebM over MP4 is not that it is better in the abstract; it is that a video element can list more than one source and the browser takes the first it understands. Put the WebM first and the MP4 after it, and every visitor gets the smaller file where their browser supports it and a working file where it does not.
That only works if you own the markup. A GIF being sent to a client, posted to a forum or dropped into a slide deck has no fallback mechanism, and there WebM is a worse choice than MP4 for a reason that has nothing to do with the codec. This page assumes you are editing the HTML yourself.
Both codecs work the same way in outline: store one complete frame, then store the differences. VP9 arrived roughly a decade later and spends considerably more effort per frame deciding how to partition the picture and where to search for matches, which buys real bytes on material that repeats.
GIF material is unusually good for it. Flat colour, hard edges, large unchanged regions and synthetic motion are all cases where a bigger search finds more, so the gap between VP9 and H.264 on a converted GIF is wider than the gap on camera footage. The cost is encoding time, which you pay once, in this tab, rather than on every page load.
The container’s record here lists it as streamable, and that is the second saving on a page. A browser can begin playing a WebM from its first bytes, so the animation starts while the rest is still coming down.
A GIF cannot do that in any useful sense. Browsers will show early frames as they arrive, but the loop does not run properly until the whole file has landed, which on a slow connection means a static first frame sitting there for seconds. Replacing a GIF with a WebM changes the shape of that wait as well as its length.
WebM is one of the very few video formats capable of storing transparency, and its record in this registry says so. That capability is real, and it is worth knowing about because it makes WebM the format people reach for when they want a video that floats over a page background.
The file this conversion writes does not use it. The video track is opaque, so a GIF whose background was declared transparent loses that on the way through, and there is no background-colour setting on this pair to control what replaces it. If transparency is the point of the animation, animated WebP is the honest recommendation: it keeps the alpha channel and it plays everywhere.
Every frame of a GIF is drawn from a palette of at most 256 colours. Whatever smooth gradient or soft shadow the animation started with was reduced to that when the GIF was written, often with dithering applied to hide the steps.
VP9 stores what it receives and imposes no palette of its own, so the animation does not get worse. It also cannot get better, and dithering is actively expensive: it is noise, and noise is the one thing that defeats a video codec’s search for redundancy. A heavily dithered GIF produces a larger WebM than a flat one of the same size, and raising the quality band spends bytes preserving the dither pattern rather than the picture.
GIF delays are per frame and stored in hundredths of a second, so a GIF frequently runs at rates no camera ever produced — 12.5 frames a second, or several different rates inside one file. The conversion carries each frame’s own duration into the video rather than resampling to a constant rate.
A stored delay of zero is common and means "as fast as the display allows"; browsers have long treated it as 100 milliseconds and so does this conversion. The practical result is that an animation timed by eye in a GIF editor plays at the same speed as a WebM, which is not something a fixed frame rate would have preserved.
Both video codecs used on this site want even pixel dimensions, and a GIF is under no such obligation. Widths and heights are rounded up to the next even number before the first frame is drawn, so a 405-pixel-wide GIF produces a 406-pixel-wide WebM.
Rounding up adds a column rather than removing one, which keeps the edge of the animation. If the video is laid out with a fixed CSS width the extra pixel never surfaces; if you are matching it against a background image pixel for pixel, it is worth knowing the number moved.
Replacing an image element with a video element is not a like-for-like swap and it is the step most likely to go wrong. The video needs an explicit width and height or an aspect-ratio rule, or the page reflows when it loads — which converts a bandwidth problem into a layout-shift problem and leaves the performance report no happier.
A poster frame is the other thing worth adding. Without one there is a blank rectangle until the first frames decode, where the GIF at least showed something. Exporting the first frame as a small WebP or PNG covers it.
The frames are read by the browser’s own image decoder and encoded by its own video encoder, in the tab you are looking at. There is no server in the path, no queue, no account and no daily allowance, and a batch takes 100 files at once.
That decoder is not present everywhere. Where it is missing the page says so and names browsers that have it, rather than quietly sending the file elsewhere to be finished — which is the one thing that would make the claim above untrue.
| GIF | WebM | |
|---|---|---|
| Full name | Graphics Interchange Format | WebM Video |
| File extension | .gif | .webm |
| Media type | image/gif | video/webm |
| Compression | Lossless — nothing is discarded | Lossy — file size is bought with quality |
| First published | 1987 | 2010 |
| Published by | CompuServe | |
| Specification | GIF89a | — |
| Licensing | Open standard | Open standard |
| Standing today | Legacy, still read everywhere | Current |
| Bit depth | 8 | — |
| Colour it can describe | indexed palette | — |
| Largest image | 65,535 px per side | — |
| Opens in a browser | Every browser | Every browser |
| Considered instead | WebP, MP4 | MP4, MKV |
Transparency survives. Both GIF and WebM store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.
WebM is a container rather than a single format. What actually plays is the codec inside it — usually VP8, VP9 and AV1 — which is why two files with the same extension can behave differently on the same device.
GIF dates from 1987 and is largely superseded. WebM is what current software writes, so the conversion is as much about staying readable as about the file itself.
The usual programs do not overlap: GIF opens in GIMP, Adobe Photoshop and ImageMagick, WebM in VLC and FFmpeg — so whoever receives the result needs something from the second list.
GIF is CompuServe's format, published in 1987. It records 8 bits per channel.
WebM comes from Google and dates from 2010. VLC and FFmpeg all read it.
GIF was published in 1987 and WebM in 2010. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.
Usually, and often by a fifth or more. VP9 is a newer codec than H.264 and spends more effort per frame to find redundancy, which shows up most on flat, synthetic material — exactly what a GIF usually is. In our own testing on a 448 KB GIF the WebM came out at 19 KB against 23 KB for MP4.
It is the safe answer. A video element accepts several source elements and the browser takes the first one it can play, so listing the WebM first and an MP4 after it costs one line and removes every doubt about older devices, embedded browsers and in-app webviews. If you serve only one file, MP4 is the one that never surprises you.
VP9 for the picture, and no audio track, because a GIF has no sound to carry. WebM is defined around VP8, VP9, AV1 and Opus, and VP9 is the pairing chosen here: it is what the container exists for and it is decoded by every browser that opens WebM at all.
Not from this conversion. WebM is one of the few video formats that can carry an alpha channel at all, but the video track written here does not have one, so a GIF with a transparent background comes out without that transparency. If a floating logo animation is the goal, animated WebP keeps transparency and plays in every current browser.
Modern Safari plays VP9 in WebM. Older versions on older hardware do not, and that is the entire reason to keep an MP4 as a second source rather than to avoid WebM. Serving both means the browser picks and you never have to know which one it took.
No. The GIF is decoded frame by frame by the browser’s own image decoder and encoded as VP9 in the same tab. Nothing is sent to a server, there is no account and no daily allowance, and a batch runs to 100 files at once.
The claims this page makes about GIF and WebM are checkable, and these are the documents that settle them.