New:Thread Pilot—AI follow-ups for Gmail.
Learn more

File Formats

Why Are GIFs So Big?

Published August 25, 2026 · ~6 minute read

Quick answer: GIF stores each frame as its own palettized image and has essentially no compression between frames, so file size is frames multiplied by pixels. A video codec stores only what changed. That single architectural difference is why a three-second clip is a few hundred kilobytes as an MP4 and ten megabytes as a GIF.

GIF was published in 1987, by CompuServe, for dial-up. It predates the World Wide Web by two years and every modern video codec by more than a decade. It is remarkable that it still works everywhere. It is not remarkable that it is inefficient.

Understanding why it is inefficient is genuinely useful, because it tells you which knob to turn when a GIF is too big — and when to stop turning knobs.

What a GIF actually stores

Three design decisions account for almost all of the size:

  1. A palette of at most 256 colors. Each frame carries a color table with up to 256 entries, and every pixel is an index into it. A photograph has far more than 256 distinct colors, so it has to be quantized, and the quantization is usually hidden with dithering — which, as we will see, costs bytes.
  2. LZW compression, within a frame only. LZW finds repeated byte runs. It is decent on flat, blocky content and poor on noisy, detailed content. Crucially it operates on one frame’s pixel indices at a time. It has no concept of the previous frame.
  3. No motion compensation. This is the big one. Modern codecs encode a frame as “the last frame, but this block moved eleven pixels left.” GIF has nothing like it. The best it can do is a frame-differencing trick where a frame only redraws a changed rectangle, which helps on screen recordings with a still background and helps almost not at all on anything with camera movement.

Put those together and the size of a GIF is roughly: frames × pixels × how compressible each frame’s indexed data happens to be. No setting changes that structure. Every optimization is a way of reducing one of those three terms.

Why the same clip is so much smaller as video

Take a screen recording of someone typing into a form. In H.264, the first frame is stored in full and every frame after it is stored as a small set of differences: the cursor moved, six characters appeared. The unchanged nine tenths of the screen costs almost nothing.

In GIF, that unchanged nine tenths is paid for again on every frame that has to be redrawn, and it is paid for in palettized pixels with a compressor that cannot see across frames. Add the fact that H.264 uses a full color space, spends bits where motion actually is, and applies perceptual quantization, and the outcome is not close.

This is why every platform that once encouraged GIFs quietly converts them to video behind the scenes. When you post a “GIF” on X, Reddit, or Discord, what actually plays back to other people is usually an MP4. The format survived as a user-facing idea — short, silent, looping, autoplaying — long after it stopped being the format doing the work.

What this means for shrinking a GIF

Since size is frames × pixels × compressibility, there are exactly three places to attack, and they have very different exchange rates:

LeverWhat it does to sizeWhat it costs
DimensionsFalls with the square of the scaleDetail, and small text first
Duration / frame rateFalls in proportionContent, or smoothness
Color countVaries wildly by contentBanding on gradients and skin
DitheringCan increase sizeNoise, in exchange for hiding banding

The counterintuitive row is the last one. Dithering is the standard fix for a reduced palette, but it works by adding high-frequency noise, and LZW compresses noise badly. On flat content, turning dithering down both looks better and produces a smaller file.

When to stop optimizing and change format

There is a floor. If your GIF is already under 12 frames per second, under 400 pixels wide, and down to 64 colors and it is still too large, you have exhausted the format. No compressor is holding out on you.

At that point the answer is convert it to MP4. Discord, Slack, X, and every browser autoplay short muted MP4s inline and loop them, which is what people wanted from a GIF in the first place. The two remaining GIF-only cases are email newsletters, where clients will not play video, and upload fields that accept images only.

Frequently asked questions

Why is my 3-second GIF bigger than a 3-minute song?

Because they are storing completely different amounts of information. An MP3 stores roughly 128 kilobits of audio per second. A 480x270 GIF at 15 frames per second is storing about two million pixels per second, each drawn from a palette, with almost no compression between frames. Video formats solved this with interframe prediction; GIF, designed in 1987, never had it.

Why does the same clip get much smaller as an MP4?

H.264 stores what changed between frames rather than re-encoding each frame nearly in full, and it uses a full 24-bit color space instead of 256 palette entries per frame. On a clip with a mostly static background, the difference is dramatic: the background is effectively free after the first frame in H.264 and is paid for repeatedly in GIF.

Does the number of colors really matter that much?

Yes, but indirectly. The palette itself is at most 768 bytes, which is nothing. What matters is that fewer distinct colors make the pixel index data far more repetitive, and GIF's LZW compression pays for repetition. A screen recording that uses 40 real colors compresses dramatically better than a photograph dithered across 256.

Why do some GIFs get bigger when I add dithering?

Dithering scatters pixels of adjacent colors to fake a smoother gradient. That scattering is high-frequency noise, and LZW compresses noise badly, because it works by finding repeated runs. A dithered GIF can be larger than the same GIF at the same color count without dithering, which is why heavy dithering on flat graphics is a bad trade.

What is the single fastest way to make a GIF smaller?

Reduce the pixel dimensions. File size tracks total pixels, so halving the width also halves the height when the aspect ratio is locked, leaving about a quarter of the pixels. Most GIFs are stored far larger than the box they render in, so this is usually free in practice.

Work on your GIF

All of these run entirely in your browser. No upload, no account, no watermark.

Contact

Tell us what you're building and we'll get in touch fast

Ship a proof-of-concept, integrate credit reporting, or hand off the workflow entirely—we respond within one business day and loop in the right Switch Labs partner for your stack.

Response Time
< 24 hours
Delivery Options
Product | Services

By submitting you agree to let Switch Labs contact you about relevant products and services.