The Format

What Is a GIF, Really? Inside the Format That Refuses to Die

GIF Download · 2026

The GIF turned 39 in 2026, and it still refuses to die. Steve Wilhite's team at CompuServe shipped the format in June 1987 to squeeze color images through 2400-baud modems. What they built outlived CompuServe itself, survived two patent scares, and became the default unit of reaction culture on the modern internet.

Understanding why the GIF persists means understanding what it actually is: a stack of indexed-color frames, compressed with LZW, looped by a handful of bytes in an extension block. Everything people love and hate about the format follows from those three decisions.

Diagram-style illustration of a GIF file broken into stacked animation frames

What sits inside a .gif file

Every GIF starts with a six-byte header, either GIF87a or GIF89a. The 89a revision, published in 1989, added the features that made the format explode: transparency, interlacing tweaks, and the Graphics Control Extension that carries frame delays. A loop is not part of the original spec at all. It comes from the Netscape Application Extension, a vendor block that browsers adopted universally by the mid-1990s.

Frames are stored as palettes of at most 256 colors. Each pixel is a single byte pointing into that palette, which is why GIF handles flat graphics, logos, and pixel art beautifully but turns photographic gradients into banded mush. There is no per-frame audio track, no metadata standard worth trusting, and no true streaming: the decoder walks frame by frame.

LZW and the patent war that almost killed it

GIF compresses each frame with Lempel-Ziv-Welch, a dictionary algorithm Unisys patented in 1985. When Unisys announced licensing fees in December 1994, the developer community revolted. That revolt produced PNG as a patent-free still-image replacement, and it pushed many tools to treat GIF as a liability. The US patent expired in 2003, the last international ones in 2004, and the format has been free to use ever since.

Why 256 colors turned out to be a feature

The palette limit sounds like a flaw, yet it keeps encoders honest. A small color table means tiny files for line art and sharp edges, and the constraint forces creators to think about which frames matter. Modern encoders cheat a little by giving each frame its own local palette, so a well-made 2026 GIF can carry far more than 256 colors across its full runtime without breaking the spec.

  • Header: GIF87a or GIF89a signature, six bytes
  • Global palette: up to 256 colors, optional
  • Frames: each with its own delay, disposal method, and optional local palette
  • Loop count: Netscape extension, 0 means infinite
  • Trailer: a single 0x3B byte closes the file
PropertyGIF89aPNGAnimated WebP
Colors per frame256 max16.7 million16.7 million
CompressionLZW, losslessDeflate, losslessVP8/VP8L, both modes
Animationnative, every browserAPNG, partial supportnative, every modern browser
Transparency1-bit on/offfull alphafull alpha
Typical size for a 4s loop1.5–4 MB5–12 MB (APNG)0.3–0.9 MB

Where the format stands in 2026

GIPHY and Tenor still serve billions of GIFs daily, though most clients transcode them to MP4 or WebP on the wire and keep the .gif label for the vibe. Messaging apps render real GIF files mainly in fallback paths and on older devices. The format survives less because it is efficient and more because it is universal: every image viewer, every forum, every email client from the last thirty years opens one without a plugin.

For creators the practical takeaway is simple. Author in GIF when you need guaranteed playback in places you do not control, like documentation, README files, and email. Ship WebP or short MP4 loops when file size and smoothness matter more than compatibility. The sections below this article cover both paths in detail.