Animated GIFs are still the easiest way to show a quick UI interaction, a product feature, or a reaction inside a chat app or documentation page. They autoplay, loop, and require no player controls. The catch is file size: a careless export can turn a four-second clip into a 30 MB file that fails every upload limit.
The good news is that GIF size is predictable. Once you understand which levers matter, you can bring almost any short clip under a few megabytes without making it look bad.
Why GIFs get so large
Unlike modern video codecs, GIF stores every frame as a separate image with a palette of at most 256 colours. There is no motion compensation and no inter-frame prediction. That means file size grows roughly with:
- Frame count (duration × frames per second).
- Pixel dimensions (width × height).
- Number of colours and dithering in each frame.
Doubling the width and height quadruples the pixel count. Doubling the frame rate doubles the frame count. Those two changes together can multiply the file size by eight. This is why small adjustments have a large effect.
The six levers that control GIF size
1. Duration
Keep clips between 2 and 5 seconds. Going from 10 seconds to 4 seconds removes more than half the frames. If your source is long, trim it first with the Online Video Trimmer.
2. Frame rate
Most interface demos and reaction GIFs look fine at 10–12 FPS. Dropping from 30 FPS to 10 FPS cuts the frame count by two thirds. For slow pans or subtle motion, 8 FPS can still look acceptable.
3. Dimensions
You rarely need a 1920 px wide GIF. Useful targets:
| Use case | Suggested width |
|---|---|
| Discord / Slack reaction | 320 px |
| Blog post or documentation | 480–640 px |
| Retina product demo | 720 px maximum |
4. Colour count and dithering
Reducing the palette from 256 to 128 or 64 colours can shrink the file noticeably, especially for flat UI recordings. Dithering improves gradients but adds noise that compresses poorly, so disable it for screenshots and simple graphics.
5. Cropping
Cut away empty space around the subject. A tight crop of the relevant UI panel is easier to read and smaller than a full-screen capture with large dead areas.
6. Loop length
A perfect loop lets you use fewer frames. If the last frame matches the first, the viewer does not notice the restart, and you can often shorten the clip by 10–20%.
What the levers are worth: a measured test
To see how much each lever matters, I encoded the same four-second clip with ffmpeg 9.1 at different settings. The source was a detailed 640 x 360 test pattern at 30 fps, so the numbers reflect real motion and colour detail rather than a flat colour background. Every GIF used the same palette method (palettegen with stats_mode=diff) and the same paletteuse settings; only the listed variable changed.
| Export | Settings | File size | Change vs baseline |
|---|---|---|---|
| 640 px wide | 12 fps, 256 colours, dither, 4 s | 961.7 KB | +32% |
| 480 px wide (baseline) | 12 fps, 256 colours, dither, 4 s | 728.5 KB | - |
| 128 colours, no dither | 480 px, 12 fps, 4 s | 522.8 KB | -28% |
| 320 px wide, 64 colours | 10 fps, no dither, 4 s | 172.2 KB | -76% |
| 24 fps | 480 px, 256 colours, dither, 4 s | 1,369.6 KB | +88% |
| 2 seconds | 480 px, 12 fps, 256 colours, dither | 334.7 KB | -54% |
| MP4 (H.264) | 480 px, 12 fps, 4 s | 151.1 KB | -79% |
| WebM (VP9) | 480 px, 12 fps, 4 s | 93.0 KB | -87% |
The baseline GIF was 728.5 KB. The same clip as a WebM was 93.0 KB, about one eighth the size, and the MP4 was 151.1 KB. That gap is the strongest argument for using video whenever the platform accepts it.
Two results are worth calling out. Doubling the frame rate from 12 to 24 fps increased the file by 88%, which is close to the "double the frames, double the size" rule. Halving the duration almost halved the size. The palette change was smaller than either, but still saved 28% with no crop and no change to the frame rate.
These are single-clip results, not universal constants. A flat UI recording will compress better than a noisy gradient, and a different encoder will produce different numbers. The direction of each lever is what matters.
The browser converter on this site uses a fixed, fast palette rather than a per-clip optimized one. It is built for local, no-upload conversion, so a desktop encoder with palette optimization can still produce a smaller GIF at the same visual quality. Use the table above to decide which setting to change first, not as a promise of exact sizes.
Platform limits worth knowing
| Platform | Practical limit | Notes |
|---|---|---|
| Discord (free) | ~8 MB | Larger files need Nitro |
| Slack | ~5–10 MB | Workspace settings vary |
| WordPress | Site upload limit | Often 2–10 MB unless configured |
| Under 1 MB ideal | Many clients block GIFs | |
| X / Twitter | ~15 MB | GIFs are converted to video |
Always test the actual upload rather than trusting a blog post, because limits change. A good default target is under 5 MB for chat and under 2 MB for web pages.
GIF or video? Choose the right format
GIF is convenient but inefficient. For anything longer than about six seconds or larger than 720 px, a short MP4 or WebM will be dramatically smaller and higher quality. Modern browsers autoplay muted, looping video as well as they autoplay GIFs.
- Use GIF for short reactions, tiny UI loops, and places that only accept images.
- Use MP4/WebM for product demos, longer loops, and anything with smooth gradients.
A repeatable export workflow
- Trim the source to the shortest clip that tells the story.
- Export a frame at 10–12 FPS.
- Resize to 480 px wide (or 320 px for chat).
- Reduce the palette to 128 colours and disable dithering for UI content.
- Check the loop point and trim any duplicate frames at the end.
- Verify the file size against the target platform.
You can do the conversion locally with the Video to GIF Converter. The video stays on your device; nothing is uploaded. If you need to cut the clip first, use the Video Trimmer.
Common mistakes
- Exporting at 30 FPS. It rarely looks better and can triple the size.
- Keeping full-screen captures. Crop to the area that matters.
- Using dithering on flat graphics. It adds noise and file size.
- Ignoring the loop. A visible jump at the restart looks unpolished.
- Posting a 20 MB GIF. Most viewers see a broken preview or a long load.
Sources
- W3C: GIF89a specification - the format's frame, palette, and loop structures.
- MDN: Image file type and format guide - GIF - browser support and animation behavior.
- MDN: Autoplay guide - how muted, looping video can replace an animated GIF.