GIF Optimizer
Make an animated GIF smaller in your browser: scale it down, keep every second or third frame without changing its length, cut the palette, or convert it to animated WebP. It first shows how the GIF is built, frame by frame, and then reads the new file back. Nothing is uploaded.
How to Use
- Drop an animated GIF. A small test GIF made in your browser is used until you do.
- Read the structure in Show Work: size, palette, loop count, every frame’s delay and which frames take the most bytes.
- Pick the changes: scale (100% to 25%), keep every frame or every 2nd, 3rd or 4th, a palette of 16 to 256 colours, dithering, and how often it plays.
- Or convert it to animated WebP or APNG instead of GIF.
- Compare the original and the new file side by side with their sizes, then download the one you want. If the new GIF is bigger, the page says so.
Worked Example
The built-in test GIF. It is 400 × 300 pixels with 30 frames of 10 cs each, 300 cs = 3.00 seconds, looping forever, with a 256-colour palette. At 50% it becomes 200 × 150: 30,000 pixels per frame instead of 120,000, a quarter, and the file shrinks by a similar factor because LZW has a quarter as many pixels to describe; in Edge the test GIF comes out at about a third of its size.
Dropping frames without speeding up. Keeping every 2nd frame leaves ⌈30 ÷ 2⌉ = 15 frames. Each kept frame takes its own 10 cs plus the 10 cs of the frame after it, so the delays become 20 cs and 15 × 20 = 300 cs: still 3.00 seconds, at 5 frames per second instead of 10. With every 3rd frame, 10 frames of 30 cs give the same 3.00 seconds.
The common mistake: assuming re-encoding always shrinks a GIF. Tools such as gifsicle store only the rectangle that changed between frames and mark unchanged pixels transparent. A screen recording where only a cursor moves might keep a 40 × 40 patch per frame instead of the full 1,280 × 720, about 1/576 of the pixels. Writing those frames out in full, as this encoder does, can make the file bigger, so the tool compares the two sizes and tells you to keep the original when it loses.
Show Work
Formulas
Why GIFs Get So Big
A GIF stores each frame as palette indices compressed with LZW, the variable-length code compression that the GIF89a specification of 31 July 1990 describes. LZW works by finding repeated runs of pixels, so it does very well on flat graphics and badly on camera footage, where neighbouring pixels rarely repeat exactly. Every frame can use at most 256 colours, from a global colour table or its own local one, and its own delay in hundredths of a second.
The format already has the tools for small animations: a frame can cover only part of the screen, at an offset, and a disposal method says whether to leave it in place, clear it or restore what was there before, while a transparent colour lets unchanged pixels show through from the previous frame. Optimisers exploit these to store only what changed. Animated WebP and APNG work on the same idea with better compression, which is why converting usually beats re-tuning the GIF.
About This Tool
This tool makes animated GIFs smaller and shows its working. It reads the GIF’s blocks directly, the palette, the loop block and every frame’s delay, rectangle, disposal and compressed size, then decodes the frames, applies your changes and encodes a new GIF, animated WebP or APNG. The new file is read back the same way, and the two are shown side by side with their real sizes.
Everything runs in your browser; the GIF palette work runs in a background worker so the page stays responsive, and your file is never uploaded. It writes full frames rather than changed rectangles, so for GIFs that are already optimised it may not win, and it says so when that happens.
It is for anyone squeezing a GIF under an upload limit, speeding up a web page, or working out why an animation is so heavy.
Related tools: GIF from Video, Animated GIF Maker, and Universal Image Converter.
Frequently Asked Questions
Which change saves the most?
Usually the size: at 50% a 400 × 300 GIF becomes 200 × 150, a quarter of the pixels, and the file usually shrinks to between a quarter and a third. Keeping every 2nd frame halves the frames. A smaller palette helps too, but usually less: LZW compression depends more on how repetitive the pixels are than on the number of colours. Converting to animated WebP is often the biggest single saving for photographic GIFs.
Does dropping frames make the GIF play faster?
No. When frames are dropped, each kept frame takes over the delays of the ones it replaces: keeping every 2nd frame of a GIF with 10 cs delays gives 20 cs delays, so a 3.00-second GIF still lasts 3.00 seconds; it is just less smooth.
Why did my GIF get bigger?
Well-made GIFs store only the part of each frame that changed, as a smaller rectangle with transparent pixels. This tool decodes every frame in full and writes full frames, so a GIF that was already optimised that way can come out larger. The page warns you when that happens; keep the original, or try a smaller scale, fewer frames or WebP.
What do the loop options mean?
GIF loops through an extra NETSCAPE2.0 block holding a repeat count: 0 means forever, 2 means it plays 3 times. With no block at all it plays once. “Keep the original” copies whatever the file had, including no block; WebP and APNG store total plays instead, which the tool converts for you.
Is my GIF uploaded?
No. The structure is read from the file’s bytes and the frames are decoded and encoded in your browser, so the GIF never leaves your device. Decoding needs a browser with WebCodecs ImageDecoder: Chrome, Edge and Opera.
How do I use the GIF Optimizer?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Fit a chat or forum limit
Take a 12 MB reaction GIF under an 8 MB upload limit by scaling it to 75% (56% of the pixels).
Lighter pages
Convert a 3 MB GIF on a landing page to animated WebP, which is usually several times smaller.
Email newsletters
Keep every 2nd frame and use 64 colours so an animated banner loads quickly in mail clients that only play GIF.
Find out why a GIF is heavy
See which frames take the most bytes and whether it already uses sub-rectangles, before you try to shrink it.
Last updated: