Base64 to Image Converter

Paste a Base64 string or data URI, preview the picture, and download it as a PNG, JPG or WebP file.

Decoded image preview

Quick answer: how to convert Base64 to an image

Paste the Base64 string into the box, click Decode image, and check the preview. If it looks right, choose a format and click Download image. The tool works out the file type for you, and nothing leaves your browser.

  1. Copy your Base64 string or full data URI.
  2. Paste it into the box above.
  3. Click Decode image to see the picture.
  4. Pick PNG, JPG, WebP or the original format, then download.

This free Base64 to image converter turns encoded text back into a picture you can see and save. Paste a raw Base64 string or a full data URI, and the tool will decode it, detect the image type, and show a preview. It’s an online Base64 decode tool built for images: PNG, JPG, GIF, WebP, BMP and SVG all work.

It also understands pasted code. If you paste an HTML <img> tag or a CSS url() rule, it finds the data URI inside. Everything runs in your browser, so your data stays on your device.

Why use this Base64 to image converter

Step-by-step guide

1. Get the Base64 text

Copy the string from your API response, database field, HTML file, or CSS file. Copy all of it. A cut-off string decodes to a broken image or fails to decode.

2. Paste and decode

Paste into the box, or click Paste from clipboard. Then click Decode image. The preview shows up below the buttons, along with the detected type and dimensions.

3. Choose a format and download

Keep the original format for an exact copy of the decoded file. Choose PNG for lossless output, JPG for smaller photos, or WebP for modern, compact files. Converting a transparent PNG to JPG fills the background with white.

Want to go the other way? Use the Image to Base64 Converter. If the decoded image is too large, try Resize Image or Compress Image File.

Supported formats, specs and limits

ItemDetail
InputRaw Base64, data URI, HTML img tag containing a data URI, CSS url() with a data URI
Detected image typesPNG, JPG, GIF, WebP, BMP, SVG (others are used if the prefix names an image type your browser can show)
URL-safe Base64Supported (- and _ are converted)
Missing paddingFixed automatically
Max input sizeAbout 15 million characters
Output formatsOriginal, PNG, JPG (quality about 92%), WebP (quality about 92%)
Not supportedBase64 that decodes to non-image files, such as PDF or ZIP

How Base64 decoding works

Base64 writes binary data with 64 text characters. Decoding reverses it: every 4 characters become 3 bytes of the original file. Those bytes are the image file itself, exactly as it was before encoding.

A data URI looks like data:image/png;base64,iVBORw0.... Before the comma is the type. After it is the data. A raw string has no prefix, so the tool checks the first bytes. PNG files start with the bytes that encode to iVBORw0KGgo, JPG files usually start with /9j/, GIF with R0lGOD, and WebP with UklGR.

Decoding in your own code

// Browser JavaScript
const img = new Image();
img.src = 'data:image/png;base64,' + base64String;

# Python
import base64
open('out.png', 'wb').write(base64.b64decode(base64_string))

Use cases

Expert tips and common mistakes

Privacy and security

Your Base64 data is processed in your browser and is never uploaded. The page decodes the text with built-in browser functions, creates a temporary local link for the preview, and draws the image on a canvas only if you choose to convert it. No data is sent to a server.

Be careful with what you decode. A Base64 image from an unknown source is just an image, but it may show content you don’t expect. Never paste secrets, such as private keys or passwords, into any online tool unless you’re sure how it works.

This tool vs alternatives

This browser toolCommand lineServer-based sites
SetupNoneTerminal and correct commandNone
Data leaves your deviceNoNoOften yes
Instant previewYesNo, you open the file afterVaries
Format conversion on downloadPNG, JPG, WebPNeeds extra toolsVaries
Best forQuick checks and one-off filesScripts and batchesConvenience

Troubleshooting

Glossary

Frequently asked questions

Is this Base64 to image converter free?

Yes. You can decode as many strings as you like at no cost. There are no credits, trials, or paid tiers, and no watermark is added to the images you download.

Is it safe to paste my Base64 data here?

Your data is decoded in your browser and is not uploaded. No server receives the text or the image. Still, avoid pasting secrets like passwords or private keys into any online tool.

Do I need to sign up?

No. There’s no account, login, or email request. Open the page, paste your Base64 text, decode it, and download the image. Nothing is saved because there’s nowhere to save it.

Do I need the data:image prefix?

No. The tool accepts a raw Base64 string without any prefix. When the prefix is missing, it identifies the image type from the file’s first bytes. A full data URI also works, as does an img tag.

Is there a size limit?

The input can be about 15 million characters, which is roughly an 11 MB image. Very large strings can slow your browser, since the text has to fit in a text box. Smaller images decode instantly.

Does it work on mobile?

Yes. The layout is responsive and the buttons are sized for touch. Paste your string into the box, tap Decode image, and download the result to your phone’s files or gallery.

Can I convert Base64 to PDF here?

No. This tool decodes images only. If your Base64 contains a PDF, it will report that the decoded data isn’t an image. Decoding a PDF needs a different tool built for documents.

Why does my Base64 string fail to decode?

Common causes are a cut-off string, extra quotes, escaped slashes, or text that isn’t Base64 at all. Copy the full string again, remove any surrounding characters, and check that it only has letters, numbers, plus, slash and equals signs.

Is Base64 decoding the same as decryption?

No. Base64 is an encoding, not encryption. Anyone can decode it without a key. That’s why this tool needs no password, and why Base64 shouldn’t be used to protect private data.

Conclusion

Turning a Base64 string back into an image should take seconds, not setup. This free online Base64 to image converter decodes your text, shows the picture, and lets you download it as PNG, JPG or WebP. Paste your string above and see what’s inside. Need to encode images instead? Try the Image to Base64 Converter.

Related tools