GIF in one paragraph
GIF stands for Graphics Interchange Format. It is an image file format that can store one picture or a sequence of pictures, called frames, and that can tell the viewer how long to show each frame and how many times to repeat the sequence. When the frames are played one after another, you get a short animation. A GIF has no sound and it is limited to 256 colors per frame, which is why GIFs look the way they do: graphic, a little grainy and instantly recognizable.
Where GIF came from
The format was created at CompuServe, an early online service, by a team led by the programmer Steve Wilhite. The first version, GIF87a, was released in 1987. The aim was practical: CompuServe wanted a way for people with very different computers to share color images over slow modem connections, and the format had to be compact. A second version, GIF89a, followed in 1989. It added transparency, text and comment blocks, and the controls that make animation possible, including the delay between frames.
The compression inside a GIF uses an algorithm called LZW, short for Lempel-Ziv-Welch. It finds repeated patterns of pixels and stores them in a short form. It works well on flat colors and sharp edges, such as logos and cartoons, and badly on photographs, where almost every pixel is slightly different from its neighbor.
How animation was added
Animation is not a separate feature bolted on later; it comes from the way the file is built. A GIF is a stream of blocks, and nothing stops a file from holding more than one image block. The 89a version adds a small control block before each image that says how long to show it, measured in hundredths of a second, and what to do with it before the next frame appears. Early web browsers showed only the first frame of such a file.
The loop came from the browser makers. In 1995 Netscape added support for playing multi-frame GIFs in its browser, along with an extension that tells the browser how many times to repeat. That extension is not part of the original specification, but other browsers copied it, and it is the reason a GIF can run forever. Together, those two steps made the animated GIF a standard part of the web in the 1990s.
What is inside the file
A GIF starts with a short header that says “GIF89a” or “GIF87a”, followed by the width and height of the picture, which can be up to 65,535 pixels in each direction. After that come the optional global palette and then a series of blocks: image data, timing and transparency controls, and the loop setting. Each image block can cover only part of the canvas, so an encoder can store just the rectangle that changed between two frames. This is the main trick that keeps simple animations small, and it is why a flat cartoon with a still background makes a much lighter GIF than a handheld video.
The patent story
In the mid-1990s it became known that the LZW compression used in GIF was covered by a patent held by Unisys, and that software makers might be asked to pay license fees. The announcement upset many developers. One response was the creation of PNG, a new image format designed to be free of the patent issue, which was standardized later in the decade. The relevant patents expired in the early 2000s, and GIF has been free to implement since then.
How a GIF stores color
A GIF picture does not store a color for each pixel directly. It stores a palette, a table of up to 256 colors, and then, for each pixel, a number that points to an entry in the table. A GIF can have one palette for the whole file or a separate palette for each frame. Transparency works in the same way, with one palette entry marked as see-through. That means a pixel is either fully transparent or fully solid, and there is no partial transparency. This is why the edge of a cut-out character can look jagged on a different background.
Squeezing a photograph into 256 colors forces choices. Software can approximate smooth gradients by mixing dots of different colors, a technique called dithering. It hides banding but adds noise, and noise makes files larger. Our guide to GIF compression explains how to find the balance.
Why GIFs get big
Video formats such as MP4 store a frame once and then describe only the changes in the frames that follow, and they use clever prediction for movement. A GIF can skip pixels that did not change from one frame to the next, and good encoders do, but it has no way to describe motion. For anything with camera movement or a lot of detail, every frame is nearly a new picture. That is why a three-second GIF can be several times larger than the same clip as a video. GIF vs MP4 vs WebP compares the numbers and the use cases.
Why GIF is still here
With newer, smaller formats available, GIF survives because it is simple and universal. Nearly every browser, chat app, email program, image editor and operating system can open a GIF. You don’t need a video player, a codec or a plugin, and the file is just an image that happens to move. For short reactions and small animations, that convenience wins over technical efficiency. Many apps that seem to use GIFs, from social networks to messengers, convert them to video behind the scenes to save bandwidth, and the user still sees a looping picture.
How do you say it?
People have argued about this for decades. Steve Wilhite said that he intended the word to be pronounced like “jif”, with a soft g, a view he repeated when he received a lifetime achievement award at the Webby Awards in 2013. Many people use a hard g, as in “gift”, because the g in “graphics” is hard. Major dictionaries list both pronunciations as acceptable. The practical answer: either one is understood, and nobody will misunderstand you.
What you can do with a GIF today
- Browse reactions and animations in our GIF catalog.
- Make your own from a clip with Video to GIF or from pictures with the GIF maker.
- Make it smaller with the compressor, or learn the size limits of the apps you use.
- Read about making a good GIF, accessibility and licenses.