Loading Base64 to Image Converter...

How to Convert Base64 to a WebP Image

WebP is what a lot of modern sites serve by default, so it is also what you find when you dig a thumbnail out of an API response, a CMS export or a canvas snapshot. Paste the Base64 below to see the picture and save it as a proper .webp file.

Step 1

Paste the Base64 string

Paste the string into the input panel or upload a .txt file that contains it. A data:image/webp;base64, prefix, line breaks and URL-safe Base64 are all fine.

•
Spot a WebP: the string begins with UklGR (RIFF in Base64) and has RUJQ (WEBP) a few characters later.
•
Copied from HTML, CSS or JSON: the data:image/webp;base64, prefix can stay; it is removed before decoding. Drop the surrounding quotes or url(...).
•
About the Sample button: it loads a small PNG, not a WebP, which shows how the page names a file by its real format.
Step 2

Check the preview

The string is decoded as soon as you stop typing and the image appears in the preview. The Format line shows what the decoded header says the file really is.

•
Transparency and animation: see-through areas show the page background, and an animated WebP loops in the preview.
•
A bad character: if something in the string is not Base64, the error gives the line and column where it sits.
•
Not an image after all: if the bytes turn out to be text, a PDF or an archive, the page says so. Base64 to File can save any kind of data.

What is inside a WebP

A RIFF header, then one or more chunks. A simple lossy image is a single VP8 chunk, a lossless one a single VP8L chunk, and anything with extras (an alpha channel on a lossy image, animation frames, EXIF or a colour profile) starts with a VP8X chunk that lists which extras follow. The WebP container specification describes each chunk, and Base64 itself is defined in RFC 4648.

Step 3

Download the WebP

Click Download to save the decoded bytes as a .webp file. On wider screens you can type a file name first.

•
Same file as before: the download is byte for byte what was encoded, so quality, metadata and file size match the original.
•
Next one: click Clear and paste the next string.
•
Other formats: Base64 to PNG and Base64 to Image use the same decoder, and Image to Base64 goes the other way.

Frequently Asked Questions

How can I tell that a Base64 string is a WebP?

A WebP file is a RIFF container, so its first bytes spell RIFF, then the file size, then WEBP. In Base64 that means the string starts with UklGR, and a few characters later you will see RUJQ, which is the WEBP part. The page checks the decoded header for you and shows the real format next to the preview.

Can I tell lossy from lossless before decoding?

Usually, yes. Look at the 21st character. If the string starts UklGR...XRUJQVlA4I it is a plain lossy WebP, VlA4T means lossless, and VlA4W means the extended format, which is what you get for lossy images with transparency, animations and files carrying EXIF or ICC data. Either way the page decodes it the same.

Will transparency and animation survive?

Yes. Nothing is redrawn or re-compressed. The file you download holds exactly the bytes that were encoded, so the alpha channel, every animation frame, the frame timing and the loop setting are all still there, and an animated WebP plays in the preview just as it would on a web page.

Where do Base64 WebP strings usually come from?

CDNs and image services that send WebP to browsers that ask for it, CMS and e-commerce APIs that put thumbnails into JSON as data URIs, and canvas code calling toDataURL with image/webp. Note that some browsers cannot write WebP from a canvas and quietly hand back a PNG instead; paste that string here and the page will say PNG.

Which browsers can show the decoded WebP?

Current Chrome, Edge, Firefox and Opera, and Safari 14 or later (on macOS that also needs Big Sur or newer). If your browser cannot draw the file, the preview stays blank, but the download is still the complete WebP and opens anywhere WebP is supported.

Can I get a PNG or JPEG out of this instead?

Not on this page. It gives you back the file that was encoded and never converts formats, so a WebP is saved as .webp. If the string turns out to be a PNG or JPEG, it is labelled and saved under its real extension. The Sample button loads a small PNG for exactly that reason, so do not expect a WebP from it.

Is my image uploaded anywhere?

No. The string is decoded by JavaScript in your browser, and the preview and the download are made on your own machine. Nothing is sent to a server and nothing is kept, so a reload starts with an empty editor.

Related pages: Image to Base64 · Base64 to GIF · Base64 to File