Base64 to GIF Converter

Paste Base64 that contains a GIF and save it as a .gif file with every frame intact, or convert a still image to GIF with a 256-colour palette built from its own colours.

Runs entirely in your browser. Nothing is uploaded.

How to use

  1. Paste the Base64 string or the data:image/gif;base64 URI.
  2. Check the preview and the detected format, dimensions and size.
  3. For an animated GIF, set the download format to Original so all frames are kept. For a still image, keep GIF to convert it.
  4. Download the .gif file.

GIF data in Base64

A GIF file starts with the text GIF89a or the older GIF87a. In Base64 these become R0lGODlh and R0lGODdh, so the first six characters R0lGOD are a reliable sign. Base64 GIFs appear as loading spinners embedded in CSS, tiny transparent tracking pixels in emails and web analytics, and reaction animations stored in chat or forum databases. GIF is popular for tiny inline images because a 1 × 1 transparent GIF is one of the smallest valid image files, only a few dozen bytes long.

Keeping the animation

The Original download writes the decoded bytes unchanged, so every frame, the frame timing and the loop setting survive. Every converted output is built by drawing the image onto a canvas, and a canvas holds only one picture. Converting therefore keeps only the first frame, even when the target is GIF again.

That limitation is also useful: to grab the first frame of an animation as a still image, paste the GIF and download it as PNG or JPG.

How the GIF converter handles colour and transparency

  • 256 colours. GIF stores at most 256 colours per image. The converter picks the palette from the image itself with the median-cut method, which works well for logos, icons and simple graphics. Photos and smooth gradients can lose subtle shades.
  • 1-bit transparency. Each pixel is either fully transparent or fully opaque. Soft shadows and anti-aliased edges become hard edges.

When colour accuracy or soft transparency matters more than GIF compatibility, PNG or WebP is the better target.

On the command line, decoding takes one step: base64 --decode spinner.txt > spinner.gif.

Frequently asked questions

Why does my GIF stop moving after conversion?

Converted output contains only the first frame. Choose Original as the download format to save the animated GIF exactly as it was encoded.

Why does the converted GIF look banded or grainy?

GIF can hold only 256 colours, so images with many shades, such as photos, are reduced to the closest palette colours. Use PNG or WebP if you need the full colour range.

What happens to semi-transparent pixels?

GIF transparency is on or off. Each pixel becomes either fully transparent or fully opaque, which can leave a jagged outline around soft edges.

How do I turn a GIF back into Base64?
Use GIF to Base64. Keep the original file so the animation is included in the encoded string.