Skip to content
snowkitDev

Turn Base64 back into an image

Paste a data URL or a raw Base64 string to preview the picture and save it as a file.

Image and Base64

Add images to get data URLs, or paste Base64 to get the image back.

    or drop them anywhere on this page

    PNG, JPEG, GIF, WebP, SVG, BMP, ICO or AVIF. You can add several at once.

    Images are read on this device and never uploaded

    Switch direction at the top to decode a data URL you already have. Turn images into Base64 text and data URLs for web pages, emails and code, or turn Base64 back into an image file. It is free and private.

    How to convert an image to Base64

    1. Choose the Image to Base64 direction.
    2. Press Choose images and pick one or more files.
    3. Copy the Base64 or data URL for each one. The original and encoded sizes are shown.

    How to turn Base64 back into an image

    1. Choose the Base64 to image direction.
    2. Paste the text into Base64 or data URL.
    3. Check the preview, then download the image. Clear empties the box.

    Why Base64 is a third bigger

    Base64 writes every 3 bytes of the file as 4 plain text characters, so the encoded text is about 33% larger than the image itself, plus a short data:image/png;base64, prefix for a data URL. Each image shows both sizes so you can see the cost before you paste it in.

    When a data URL makes sense

    Embedding is handy for small things: icons, tiny backgrounds, email signatures, a favicon or a single file that must work offline. For anything over roughly 10 KB, a normal image file is usually better: it can be cached by the browser, it loads in parallel with the page, and it keeps your HTML and CSS small. Large images get a reminder about this.

    Decoding Base64

    Paste a full data URL, a CSS url() line, an img tag or just the Base64 text. Spaces, line breaks and the URL-safe letters - and _ are accepted, and missing padding is added. The type is read from the first bytes of the file itself, not from the label, so a PNG mislabelled as JPEG still downloads with the right extension. If the text is not valid Base64 or is not an image, you get a plain explanation.

    Supported files

    Any image your browser can open, including PNG, JPG, WebP, GIF, SVG, ICO and AVIF.

    Tips

    • Compress or resize the image first, since Base64 makes it larger.
    • Keep large images as ordinary files and link to them.
    • Use SVG when you can for icons. It is already text and often smaller than a PNG.
    • To shrink an image before encoding, try compress image to size.

    Common uses

    Embedding a small logo in an HTML email, putting an icon directly into a style sheet, storing a picture in a JSON file, and recovering an image from a data URL you found in code. For a full set of site icons, see the favicon generator.

    Private by design

    Images are read and converted on this page in your browser. Nothing is uploaded, and the files never leave your device.

    Questions

    Is Base64 encryption?

    No. It is only a way of writing data as text. Anyone can decode it.

    Why does the decoded file have the wrong extension?

    It should not. The type is read from the file itself rather than the label.

    Why is the Base64 text so long?

    Every image becomes about a third bigger as text, and photos are large to begin with.

    Where to next

    Carry on with what you just made, still on your device.

    More from Snowkit