5 min read · Updated

How to make a GIF smaller

How to make a GIF smaller without ruining it: change the settings that matter, from the biggest saving to the smallest. A 20-megabyte GIF won't upload anywhere, but most can be brought under a few megabytes without looking worse.

Why GIFs are big

The GIF format dates from 1987. Each frame is stored as an indexed image with at most 256 colours, compressed with a simple lossless method. There's no modern motion compression, so the file is roughly the size of all the frames added together.

The savings, in order

  • Dimensions: file size scales with area. 800 px → 400 px wide is about a quarter of the size.
  • Length: trim to the moment that matters. Every second you cut is a straight saving.
  • Frame rate: 10–15 fps looks smooth for most reactions; 25–30 fps is usually wasted on a GIF.
  • Palette: one global palette for the whole GIF is smaller than a new palette for every frame (and avoids colour flicker).
  • Dithering: it smooths gradients but adds noise that compresses badly. Turn it off unless you see banding.

Let the exporter do the maths

OldMeme's GIF export has a target-size option: pick a limit (1 to 15 MB, or 256 KB for Discord emoji) and it estimates the result from sample frames, scales the dimensions (and, if needed, drops frames) to fit, then checks the real file and shrinks again until it's under the limit.

When to use video instead

If the platform accepts video, export MP4 or WebM. Modern video codecs only store what changes between frames, so the same animation is often many times smaller, and it keeps full colour.

A worked example

Take a 640 × 360 GIF with 120 frames. Each frame has 230,400 pixels. Exporting at 50% gives 320 × 180, a quarter of the pixels, so roughly a quarter of the size. Trimming it from 120 to 60 frames halves it again. Together that's about an eighth of the original, before touching the palette or dithering, and at chat size the difference is hard to see.

Limits to aim for

Upload limits change, so check the platform's help pages, but small targets come up often. Discord custom emoji must be 256 KB or less; many forums cap images at a few megabytes; and some messaging apps turn large GIFs into ordinary video messages. When a platform shows GIFs as video anyway, convert to MP4 yourself and keep full quality.