Loading Base64 to Image Converter...
How to Convert Base64 to a GIF Image
GIFs travel as Base64 more often than you might think: loading spinners inlined into CSS, reaction GIFs stored by chat bots, little icons in email signatures, and the 1 pixel spacer that still hides in a lot of HTML. Paste the string below to see what it is and get the real file back.
Paste the Base64 string
Paste the string into the input panel, or upload a .txt file that contains it. A data:image/gif;base64, prefix, line breaks and URL-safe Base64 are all accepted.
R0lGODlh (or R0lGODdh for very old files), which is just GIF89a written in Base64.data:image/gif;base64, part; it is stripped before decoding. Leave out the surrounding url(...) or quotes.Look at the preview
A moment after you paste, the string is decoded and the GIF appears in the preview, animated if the file is animated. The Format line tells you what the header says the file really is.
What is inside a GIF
A six-byte signature, the canvas size, a colour table of up to 256 colours, and then one block per frame with its own delay and an optional transparent colour. A looping animation also carries a small application block that says how many times to repeat. The GIF89a specification describes every block, and Base64 itself is defined in RFC 4648.
Download the GIF
Click Download to save the decoded bytes as a .gif file. On wider screens you can type your own file name before saving.
Frequently Asked Questions
How do I know a Base64 string holds a GIF?
Every GIF file starts with GIF89a or the older GIF87a, and in Base64 that shows up as R0lGODlh or R0lGODdh at the very beginning. You do not have to check by eye, though: the page reads the decoded header and prints the format it found next to the preview.
Will an animated GIF still move after decoding?
Yes. The page does not redraw or re-save the image. The bytes you download are the bytes that were encoded, so every frame, the delay between frames and the loop count come back unchanged, and the preview plays the animation the way your browser normally would.
What happens to the transparent parts?
They stay transparent. A GIF marks one colour in its palette as see-through, and that setting is part of the file, so it survives the trip through Base64. In the preview you will see the page background through those pixels.
I pasted the string and it says PNG, not GIF. Is something wrong?
Not with the page. It names the format the bytes really are, and the download gets the matching extension, so a PNG is saved as .png even here. Nothing is converted between formats. The Sample button is a good example: it loads a small PNG on purpose.
What is that tiny R0lGODlhAQABAIAAA... string I keep seeing in HTML and emails?
That is almost always a 1 by 1 transparent GIF, the classic spacer or tracking pixel. Paste it here and you will get a 42 or 43 byte file showing a single invisible pixel. It is harmless on its own, but in emails it is often used to tell the sender that the message was opened.
Is the Base64 sent to your server?
No. Decoding happens in JavaScript inside your browser, and the preview and the download are built on your own machine. Nothing is uploaded and nothing is kept, so a reload starts with an empty editor.
How do I get Base64 from a GIF file?
Go the other way with the GIF to Base64 page: pick the .gif there and copy the string it gives you. Decoding that string on this page returns the identical file.
Related pages: GIF to Base64 · Base64 to PNG · Base64 to File
Related Tools
Image to Base64
Convert images to Base64 encoded strings for embedding in HTML, CSS, and APIs
Base64 to Image
Decode Base64 encoded strings to view and download images (PNG, JPG, GIF, SVG)
PNG to Base64
Convert PNG images to Base64 encoded strings for embedding
Base64 to PNG
Decode Base64 strings to PNG images, see the picture and save the exact file
BMP to Base64
Convert BMP/Bitmap images to Base64 encoded strings
Base64 to BMP
Decode Base64 strings to BMP/Bitmap images