Graphics Interchange Format
image/gif
Released 1987
· by CompuServe
GIF (Graphics Interchange Format) is a widely supported bitmap image format introduced by CompuServe in 1987. It uses lossless LZW compression and is most famous for its widespread use in short, looping web animations, despite its limitation to a 256-color palette.
Technical Specifications
.gif
LZW (Lempel-Ziv-Welch)
Magic Bytes & HTTP Headers
GIF89a
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Supported | All |
|
|
Supported | All |
|
|
Supported | All |
|
|
Supported | All |
|
|
Supported | Legacy |
Advantages & Limitations
- Universal support across all web browsers, operating systems, and messaging apps
- Supports basic frame-by-frame animation out of the box
- Lossless compression is highly effective for simple, flat-color graphics like logos or pixel art
- Limited to 256 colors per frame, resulting in poor quality for complex gradients and photographs
- Animations produce massive file sizes compared to modern formats like MP4, WebP, or AVIF
- 1-bit transparency limits edge blending on non-uniform backgrounds
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/gif
file by reading its raw bytes:
- 1 Check first 6 bytes for the 'GIF87a' (47 49 46 38 37 61) or 'GIF89a' (47 49 46 38 39 61) string
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/gif)
<iframe src="https://freewebptojpg.com/mime/image/gif/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="GIF Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/gif.json
Open JSON
Frequently Asked Questions
What is the magic byte for GIF?
GIF files begin with either 'GIF87a' or 'GIF89a'. In hex, this signature corresponds to 47 49 46 38 37 61 or 47 49 46 38 39 61 at the very start of the file.
Does GIF support transparency?
Yes, but only 1-bit transparency (introduced in GIF89a). This means a pixel is either fully transparent or fully opaque. It lacks the partial transparency (alpha channel) found in PNG or WebP, which often leads to jagged, un-aliased edges.
Why do GIFs sometimes have poor color quality?
The standard GIF format is restricted to a maximum of 256 colors (8-bit) per frame. When converting complex images like photographs to GIF, the software must use color quantization and dithering, which often causes visible banding and graininess.