How to compress a GIF
- Load a GIF. Drop it on the box above, paste it, or pick a file, or try everything on the built-in sample first. The facts panel tells you its size, dimensions, frame count, and how many distinct colours it actually uses.
- Start from the plain re-encode. That is the default view: full palette, every frame, full size. Its readout is your honest baseline. On many GIFs it saves little or nothing, and the panel will say so.
- Pull one lever at a time. Cut colours first if the GIF is colourful, drop frames if it is long and smooth, shrink the size if it will be displayed small. Watch the two previews side by side at 100% zoom and read the byte saving after each change.
- Or name a number. In Target file size mode, pick the limit you have to meet and let the search find the gentlest combination that fits, and it reports honestly when a target cannot be reached.
- Download. What you watched is what you get: the preview is decoded from the same bytes as the downloaded file.
What actually makes a GIF big
A GIF's file size is, roughly, frames × pixels per frame × how hard those pixels are to describe. Every frame is stored as a grid of palette numbers, where each pixel is an index into a table of at most 256 colours, and the grid is then compressed by finding patterns: long runs of the same number, repeats from earlier in the frame. Three things follow from that. First, frame count and dimensions multiply everything, which is why shrinking the size is such a powerful lever. Second, colour count matters less than people expect on its own. What matters is how patterned the picture is. A flat logo compresses to almost nothing; film grain, camera noise and dithering speckle are close to random, and random data barely compresses at all. Third, there is no quality slider hiding anywhere in the format: every byte you save comes from removing colours, frames or pixels, or from describing what is left more efficiently. Any tool that promises big savings with no trade-off is not telling you which of the three it took.
The levers, and what each one costs
Colours (256 → 128 → 64 → 32 → 16). The tool builds one palette for the whole animation by median-cut, repeatedly splitting the colour space where the colours spread widest, so the palette slots go where your GIF's colours actually are. Shades between palette colours are rounded to the nearest one. The cost shows up first in smooth gradients (visible bands), skies, skin tones and soft shadows. Flat graphics, logos, screen recordings and pixel art often have few real colours to begin with (the facts panel counts yours) and can drop to 64 or 16 with barely a visible change.
Frames (keep every 2nd, 3rd or 4th). Removing frames removes their data entirely, so the saving is roughly proportional. The cost is smoothness: motion steps instead of gliding. What does not change is the speed: each kept frame absorbs the delays of the frames dropped after it, so a 2.00-second loop stays a 2.00-second loop. Tools that drop frames without merging the delays make your GIF play faster as a side effect; this one does not, and the readout always states how many frames were kept so the trade is never silent.
Size (75% / 50% / 25%). Halving the width and height quarters the pixel count, which is why the measured table below shows it out-performing everything else on a photo-like clip. The cost is obvious and permanent: the picture is smaller, and showing it large again later will look soft. Use it when the destination displays the GIF small (an emoji, a thumbnail, a chat sticker) and skip it when the GIF will be seen full-size.
A plain re-encode. Rebuilding the file with fresh palettes and no other change. When every frame already fits in 256 colours it changes no pixel at all, and it usually saves little or nothing. Sometimes, on a small GIF that was stored very efficiently, the rebuilt file is even larger, because the original used tricks (cropped frame patches, one shared palette) that a full-frame rebuild does not. The readout tells you the truth either way, and offers the original back when the result grew.
A sensible order for most GIFs: colours first, then size if the destination allows it, frames last, because dropped frames are the one cost you cannot disguise. That is also the order the target-size search uses.
Why dithering is a trade, not a free upgrade
Dithering scatters two palette colours in a fine checkerboard of speckles so that, from a distance, your eye mixes them into the shade in between. On a banded gradient it can look much better. But remember how GIF compression works: it eats patterns and starves on noise. The speckle is close to noise, so a dithered file is often bigger than the plain cut at the same palette. In the measured test below, dithering a smooth gradient at 64 colours produced a file larger than the original GIF it started from. Try it both ways and compare the readout; the preview at 100% zoom shows you exactly what the speckle looks like before you pay for it in bytes.
Hitting a hard limit
Sometimes the target is not a suggestion: Discord custom emoji must fit in 256 KB, chat and forum uploads have their own caps, and an email GIF over a megabyte or two is a GIF most people never see load. That is what Target file size mode is for. It tries 80 combinations of the levers above in a fixed order, gentlest first (colours before size, size before frames), and stops at the first whose real encoded size fits. On the photo-like clip from the measured table below, asking for 40% of the original (301,378 bytes), the search stopped on its second try: 128 colours, every frame kept, full size, at 241,583 bytes. Two honest warnings. First, the search encodes each candidate for real, so on a large GIF it can take a while; you can stop it any time. Second, some targets are simply impossible without destroying the GIF: ask a detailed 753,447-byte clip for 1 KB and even the harshest combination here (16 colours, 25% size, every 4th frame) only reaches 3,147 bytes. When that happens the tool says the target could not be reached and loads that smallest result, rather than quietly wrecking the picture to hit a number. If you are chasing a tight limit, trimming the GIF shorter first (fewer frames of content, not just fewer kept frames) is usually the honest way to get there.
Measured results, from our own test GIFs
These are real runs of this exact tool on three test GIFs we made for this page, not estimates, and not best cases picked from a pile. Your numbers will differ; the shapes of the results are the point.
Photo-like clip: 320 × 240, 20 frames, a gradient sky with a soft sun, hills and film grain; 4,750 distinct colours. Original: 753,447 bytes.
| Setting | Result | Change |
|---|---|---|
| Re-encode only (full palette, every frame, full size) | 754,215 bytes | 0.1% bigger |
| 128 colours | 241,583 bytes | 67.9% smaller |
| 64 colours | 186,492 bytes | 75.2% smaller |
| 64 colours, dithered | 335,654 bytes | 55.5% smaller |
| Every 2nd frame kept (full palette, full size) | 377,195 bytes | 49.9% smaller |
| 50% size (full palette, every frame) | 34,644 bytes | 95.4% smaller |
| Combined: 32 colours, every 2nd frame, 50% size | 19,501 bytes | 97.4% smaller |
Note the first row: the plain re-encode made this clip 768 bytes bigger. The colour cut did the heavy lifting among the gentle levers; dithering at 64 colours cost 149,162 bytes back versus the plain cut; and size, as always, was the sledgehammer.
Smooth gradient clip: 200 × 150, 12 frames of a shifting two-colour gradient. Original: 59,505 bytes.
| Setting | Result | Change |
|---|---|---|
| 64 colours | 13,535 bytes | 77.3% smaller |
| 64 colours, dithered | 78,986 bytes | 32.7% bigger |
The dithered file is bigger than the GIF it started from. It is the clearest case we know for checking the readout before downloading, and for judging dithering by the preview, not by habit.
Flat diagram: 240 × 160, 8 frames, six colours total. Original: 3,193 bytes.
| Setting | Result | Change |
|---|---|---|
| Re-encode only | 8,357 bytes | 161.7% bigger |
| 16 colours | 8,357 bytes | 161.7% bigger |
The bad case, kept in on purpose. This file was already stored very efficiently, with cropped frame patches and a shared palette, and rebuilding it as full frames more than doubled it. Cutting colours changed nothing at all, because six colours already fit in a 16-colour palette: there was nothing left to cut. When a GIF is already small and flat, the honest answer is often that it does not need compressing, and when that happens here, the tool says so and hands your original back.
Frequently asked questions
Can I compress a GIF without losing quality?
Only one setting here changes no pixel at all: a plain re-encode with the full palette, every frame and the full size, and only when each frame of your GIF already fits in 256 colours, which the facts panel checks for you. That path may save little or nothing. Every other lever trades something away (colours, frames or pixels), and the preview and readout show you the trade before you download.
Why did my compressed GIF come out bigger than the original?
It happens, and the readout says so when it does. A small GIF that was already stored efficiently can grow when it is rebuilt frame by frame, and dithering adds speckle that defeats GIF compression. When the result is not smaller, the tool tells you plainly and offers your original file back instead.
Does compressing change how fast my GIF plays?
No. Colour cuts and scaling never touch the timing, and when frames are dropped, each kept frame absorbs the delays of the frames removed after it, so the total duration and the playback speed stay exactly the same. The motion simply gets less smooth, and the readout always states how many frames were kept.
Why can dithering make a GIF bigger?
GIF compression works by finding patterns: runs and repeats of the same colours. Dithering deliberately scatters two palette colours in a fine speckle to fake a shade in between, and that speckle is close to random noise, which barely compresses at all. On a smooth gradient the dithered file at 64 colours came out larger than the original in our measured test above.
How do I get a GIF under a specific size, like 256 KB?
Use Target file size mode: pick a preset or type your own limit, and the tool tries combinations of colours, size and frame dropping in a fixed order, gentlest first, and stops at the first one that fits. If nothing fits, it says so and loads the smallest result it could make, instead of quietly destroying the picture to hit the number.
Related tools
Compressing is often one step in a longer job. These MotionGIF tools cover the steps that tend to come before or after it:
GIF Trimmer
Cut a GIF down to just the part you need. Fewer frames of content is the honest way to reach a tight size limit.
Open the tool →GIF Splitter
Pull every frame out of a GIF as still images, or split the animation into shorter clips.
Open the tool →GIF Speed Changer
Speed up or slow down an animated GIF by changing its frame timing, without touching its file size levers.
Open the tool →