Data URL to GIF Converter
Convert base64 Data URLs to downloadable GIF files. Extract dimensions, frame count, and preview animations instantly in your browser.
data:image/gif;base64,
About
Data URLs embed binary image data directly into text using base64 encoding. The format data:image/gif;base64, followed by encoded bytes allows GIFs to exist within HTML, CSS, or JSON without external file references. This converter decodes that base64 payload back into a native GIF file. Incorrect decoding produces corrupted files that fail to render. The tool validates the GIF87a or GIF89a header signature before processing, extracts the Logical Screen Descriptor for width × height dimensions, and counts image descriptor blocks to estimate frame count for animations.
Processing occurs entirely client-side. No data leaves your browser. Base64 encoding increases file size by approximately 33% due to the 6-bit to 8-bit conversion ratio. A 100KB GIF becomes roughly 133KB when encoded. Reverse conversion restores the original binary exactly. Invalid base64 characters or truncated strings trigger validation errors before any Blob creation attempt.
Formulas
Base64 encoding converts every 3 bytes of binary data into 4 ASCII characters from a 64-character alphabet. The encoded size relates to original size by:
Where Sencoded is the base64 string length in characters and Soriginal is the binary file size in bytes. Padding characters (=) are appended when the input length is not divisible by 3.
GIF dimensions are stored in the Logical Screen Descriptor as 16-bit little-endian unsigned integers:
Frame count estimation scans for image descriptor bytes (0x2C) throughout the file. Each occurrence marks the start of a new frame in an animated GIF sequence.
Reference Data
| Property | GIF87a | GIF89a | Notes |
|---|---|---|---|
| Magic Bytes | 47 49 46 38 37 61 | 47 49 46 38 39 61 | ASCII: "GIF87a" / "GIF89a" |
| Max Width | 65,535px | 65,535px | 16-bit unsigned integer |
| Max Height | 65,535px | 65,535px | 16-bit unsigned integer |
| Color Depth | 1 - 8bits | 1 - 8bits | Max 256 colors per frame |
| Animation | No | Yes | Uses Graphic Control Extension |
| Transparency | No | Yes | Single color key transparency |
| Interlacing | Yes | Yes | 4-pass Adam7-like scheme |
| Image Descriptor | 0x2C | 0x2C | Marks frame start |
| Extension Block | N/A | 0x21 | Comments, delays, disposal |
| Trailer Byte | 0x3B | 0x3B | End of file marker |
| Compression | LZW | LZW | Lempel-Ziv-Welch algorithm |
| Min Code Size | 2bits | 2bits | For 2-4 color images |
| Max Code Size | 12bits | 12bits | LZW dictionary limit |
| Frame Delay | N/A | 0 - 65,535 | In centiseconds (10ms units) |
| Loop Count | N/A | 0 - 65,535 | 0 = infinite loop |
| Base64 Overhead | ~33% | 6-bit encoding adds padding | |
| MIME Type | image/gif | Required in data URL | |
| Data URL Prefix | data:image/gif;base64, | Standard format | |