Check and restore a Base64-encoded image
Admin ·
Restore an image from Base64 text and preview it. Select Decode image and check the preview, dimensions and detected media type.
Read the header before decoding
A PNG data URL begins with data:image/png;base64, followed by the encoded file. If a form supplies only the payload, paste it directly. The decoder reads the signature of the decoded bytes and asks the browser to open a local image preview.
Diagnose a media type mismatch
Suppose a template declares image/jpeg but the payload contains a PNG icon. The decoder reports the mismatch. Check the original export, then supply its correct media type or paste the confirmed raw payload. A real PNG downloads with a .png extension.
Diagnose a truncated image attachment
Save the original encoded message before editing it. If the decoder recognizes PNG but the image cannot open, compare the complete payload with the source. A valid opening signature can survive even when the final portion has been lost.
If the message is wrapped inside a JSON string, decode that string first. Extra surrounding quotes or literal escape characters from the transport should not be part of the Base64 alphabet.
Common questions
Can I paste Base64 copied across several lines?
ASCII spaces, tabs and line breaks within the payload are accepted. Remove surrounding quotation marks, HTML attributes and CSS syntax before decoding.
What happens if a data URL declares the wrong type?
The decoder checks the declared media type against the image bytes. A mismatch produces an error so you can check the source before downloading.