Loading Base64 to Image Converter...
How to Convert Base64 to a HEIC Image
Paste the Base64 text
Drop the Base64 string into the input box, or load it from a .txt or .base64 file. The data:image/heic;base64, prefix, quotes from a JSON value, line breaks and URL-safe characters are all fine.
data:image/heic;base64, prefix and any surrounding quotes in placeSee what the bytes turn out to be
The page decodes the string right away and reads the file header. A real iPhone photo shows up as HEIC. Chrome, Edge and Firefox cannot draw HEIC, so in those browsers you get a short note instead of a picture; Safari usually shows it. If the bytes are really a JPEG or PNG, the page says that instead.
What a HEIC string looks like
In Base64, a HEIC file begins with something like AAAAHGZ0eXBoZWljAAAAAG1pZjFoZWlj. The first few characters depend on the header size, but the GZ0eXBoZWlj part stays the same: it spells out ftypheic, the header the page looks for. If your string starts with /9j/ instead, it is a JPEG, whatever the prefix says.
Download the .heic file
Click Download to save the decoded bytes exactly as they were encoded, with a .heic extension when the file really is HEIC. You can type a file name first.
What is Base64 to HEIC Conversion?
HEIC is the HEIF container with images compressed by HEVC (H.265). Apple made it the default camera format in iOS 11, which is why so many phone photos arrive as .heic. When one of those photos has to travel inside text, say in a JSON request body, it gets written out as Base64.
Decoding just turns those characters back into bytes. The file you download is the one that was encoded, with its EXIF data and any extra images inside the container still there, because nothing is re-compressed or converted. Base64 is about a third longer than the data it carries, so expect the .heic to be roughly three quarters the length of the text you pasted.
Frequently Asked Questions
How do I get a HEIC photo back out of a Base64 string?
Paste the string into the box at the top. If it holds a HEIC image, the right-hand panel says Format: HEIC and the Download button saves it as a .heic file. That file is the photo as it was before it was encoded, so it opens in Apple Photos, Preview, or any other app that reads HEIC.
Why is there no preview of my HEIC image?
Most browsers simply cannot display HEIC. Chrome, Edge and Firefox have no built-in decoder for it, so the page tells you the preview is not available rather than showing a broken picture. Safari on a Mac or iPhone can usually show it. Either way the decoding itself worked, and the downloaded file is complete.
Does this page convert HEIC to JPEG?
No. It only decodes the Base64, so what you download is the same HEIC file that was encoded, with nothing re-compressed. To get a JPEG, open the .heic in Photos or Preview and export it, run sips -s format jpeg photo.heic --out photo.jpg on a Mac, or use an image tool built with libheif such as ImageMagick.
My string came from an iPhone, but the page says JPEG. Why?
The format is read from the decoded bytes, not from the data: prefix or the name of this page. Many apps and APIs convert iPhone photos to JPEG before they encode them, and the Most Compatible camera setting on iOS saves JPEG in the first place. If the bytes are JPEG, the download is saved as .jpg so it opens correctly.
What does the Sample button load?
A tiny 32 by 32 PNG, so you can see how the decoder behaves. It is labelled PNG and downloads as .png. To check a real HEIC, paste your own Base64.
How can I tell a HEIC string from other images just by looking?
HEIC files start with an ftyp box that names the heic brand. In Base64 that start almost always contains GZ0eXBoZWlj, often as AAAAGGZ0eXBoZWlj or AAAAHGZ0eXBoZWlj at the very beginning. A JPEG starts with /9j/ and a PNG with iVBORw0KGgo.
What if the Base64 is broken or is not an image at all?
A character that does not belong in Base64 is reported with its line and column, and a string that was cut short is called out as well. If the text decodes but turns out to be something other than an image, such as plain text or a PDF, the page says what it found instead of offering a broken .heic.
Is my photo sent anywhere?
No. The Base64 is decoded by JavaScript in your browser, and nothing you paste is uploaded or kept. Reload the page and the box is empty again.
Related: Image to Base64 goes the other way, Base64 to Image handles the other common image formats, and Base64 to File decodes anything that is not an image.
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