CompuServe introduced GIF in 1987 to move colour images across slow modems; a palette of 256 colours was a reasonable compromise then. Animation arrived with GIF89a in 1989, and the format’s fate was sealed: it became the internet’s default moving image for three decades, long past the point where that made sense.

01The GIF problem

The technical problems compound. Indexed colour limits every frame to 256 shades, so anything photographic looks posterised. There is no audio, and no compression between frames — each is individually LZW-compressed, a codec never designed for video. A five-second clip that would be 300 KB as H.264 routinely runs 3–8 MB as a GIF. Yet it persisted because it worked everywhere: drop it in an <img> tag and it plays.

02What actually beats it

OptionVerdict
Animated WebPMillions of colours, alpha, competitive size, universal support — the like-for-like replacement.
Animated AVIFBetter compression still, especially for photographic content; support solid but not quite universal.
Video (H.264 / AV1)The honest answer beyond a few seconds — a fraction of the size.

For anything longer than a short loop, video is what every platform uses internally. Deliver it so the browser treats it like a GIF — no controls, silent, looping:

<video autoplay loop muted playsinline>
  <source src="clip.webm" type="video/webm">
  <source src="clip.mp4" type="video/mp4">
</video>
256maximum colours in a GIF palette
1987CompuServe introduced GIF
1989GIF89a added animation