About the Base64 to Image Converter
Paste a Base64 image string from an API response, HTML email, CSS file or database export and see the picture, its MIME type and decoded size, then download it as a file. A full data URL (data:image/jpeg;base64,...) sets the type and file extension. A bare Base64 string has no type information, so the tool labels it image/png.
How to use the Base64 to Image Converter
- Paste the string into Paste Base64 String, ideally with its data:image/...;base64, prefix.
- Click Convert to Image to decode it and show the preview.
- Check Image Type and File Size under the preview.
- Click Download Image to save it as converted-image with the matching extension.
- Click Clear before decoding the next string.
Worked example: decoding a 1x1 PNG from an API payload
This is the smallest common test image, a single-pixel PNG. Base64 strings for PNG files always start with iVBORw0KGgo, which is the encoded form of the PNG file signature.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==Image Type: image/png
File Size: 0.07 KB (70 bytes)
Download: converted-image.pngSpot the format from the first characters
When your string has no prefix, the first few characters tell you what it really is. Add the matching prefix before converting so the download gets the right extension:
| String starts with | Format | Prefix to add |
|---|---|---|
| iVBORw0KGgo | PNG | data:image/png;base64, |
| /9j/ | JPEG | data:image/jpeg;base64, |
| R0lGOD | GIF | data:image/gif;base64, |
| UklGR | WebP | data:image/webp;base64, |
| PHN2Zy or PD94bW | SVG | data:image/svg+xml;base64, |
- If the prefix is present but the Base64 part is split over several lines, you get "Invalid Base64 data URL format". Remove the line breaks first.
- Prefixes with extra parameters, such as data:image/svg+xml;charset=utf-8;base64, are rejected. Delete the ;charset=utf-8 part.
- Escaped slashes from JSON (\/) must be turned back into / before pasting.
- Once saved, a large decoded image can be shrunk with the image compressor or switched to another format with the image converter.
Converting Base64 strings back to viewable images
Base64 encoded images appear frequently in API responses, HTML emails, and web applications. When you receive a long Base64 string and need to see the actual image, converting it back to a standard image format lets you preview, save, and use the image normally.
This tool performs all decoding in your browser without sending data to external servers. Paste the Base64 string, preview the decoded image immediately, and download it in its original format-whether PNG, JPG, GIF, or any other image type.
Common scenarios requiring Base64 to image conversion
Web developers extracting images from JSON API responses often receive image data as Base64 strings. Converting these strings to downloadable images helps with debugging, design reviews, and saving assets from API payloads.
Email templates embed images as Base64 in HTML. Saving these embedded images requires decoding the Base64 strings back to standard image files. Database exports sometimes store small images as Base64 text fields-converting them back restores the original image files.
Understanding Base64 image encoding
Images encoded in Base64 convert binary image data into ASCII text. This allows images to be stored in text-only systems like JSON APIs, email HTML, or database text fields. The data URL format (data:image/png;base64,...) includes the MIME type and encoding type before the actual Base64 data.
While Base64 encoding increases file size by approximately 33%, it enables embedding images directly in HTML, CSS, or JSON without separate HTTP requests. Decoding reverses this process, converting the text representation back to a binary image file you can view and save.
Privacy and security for image decoding
Decoding Base64 images in your browser ensures sensitive images never upload to external servers. This matters when working with user photos, medical images, proprietary designs, or any visual content requiring confidentiality.
Client-side image decoding complies with data protection regulations by keeping image data on your local device. No server receives your Base64 strings, no processing happens in the cloud, and no audit logs record which images you decode.
Base64 to Image Converter: frequently asked questions
- How do I convert Base64 to an image?
- Paste your Base64 encoded string (with or without data URL prefix) into the text area and click Convert. The image will preview instantly and you can download it in its original format.
- What image formats are supported?
- All image formats are supported including PNG, JPG, GIF, WebP, SVG, BMP, and more. The tool automatically detects the format from the Base64 string.
- Is my Base64 data uploaded to a server?
- No. All conversion happens locally in your browser using JavaScript. Your Base64 data and images never leave your device, ensuring complete privacy.
- Can I use Base64 with or without the data URL prefix?
- Yes. You can paste either the full data URL (data:image/png;base64,...) or just the Base64 encoded string. The tool handles both formats automatically.