Base64 to image on Android works in a mobile browser: paste canonical Base64 image data, convert it, preview it, and download the original bytes as a PNG, JPEG, GIF, or WebP file.
The Base64 to Image Converter performs that work inside the active browser tab rather than uploading the data. It is not a native Android app or an SDK, so it cannot place a Bitmap into your code automatically. Its practical role is to inspect, recover, and export image data found in an API response, JSON field, email template, clipboard snippet, browser-storage value, or development log.

Decode a Base64 image on Android
Use this workflow when you already have the encoded value and want a real image file on the phone.
- Copy the encoded value at its source. In an Android app, email, JSON response, or log viewer, use the source’s Copy command. Copy only the Base64 string or data URL, not the surrounding quotation marks, field name, trailing comma, HTML, or indentation.
- Open the converter page in the Android browser. Tap the input and use Paste. A plain payload needs no prefix. A data URL must contain a comma separator and one ;base64 marker in its metadata.
- Check for accidental copy artifacts. The converter deliberately rejects whitespace, line wrapping, and URL-safe Base64 characters rather than silently rewriting them. If a payload is wrapped or uses Base64url, normalize it at the source.
- Tap Convert to image. The decoder validates the Base64, calculates the output size, detects the container, and asks the browser to decode the complete image before publishing a result.
- Review the reported format, dimensions, byte size, and preview. A preview and download appear only after the bytes pass structural checks and the browser can decode them. A false data-URL MIME label does not control the result.
- Tap Download. The saved file contains the original decoded bytes, and its extension comes from the detected PNG, JPEG, GIF, or WebP signature rather than an untrusted label.
- Open the downloaded file on the phone. Use the browser’s Downloads list or the Files app, then select the image. If you need it in a particular app, move or share the saved file from Android; the converter’s task ends at the download.
The on-screen preview may be constrained to fit the page, but that CSS sizing does not resize the downloaded image. If Photos does not show the file immediately, use Downloads or Files, where the downloaded file itself remains available.
Input formats the Android browser accepts
The converter accepts canonical RFC 4648 Base64 syntax or an RFC 2397-style data URL. Canonical Base64 uses the standard alphabet with plus and slash, has a length divisible by four, places one or two padding characters only at the end when required, and uses zero unused pad bits.
| Input form | Accepted | What to do on Android |
|---|---|---|
| Plain RFC 4648 Base64 | Yes | No prefix is required. |
| Data URL containing ;base64 | Yes | Include the comma separator and exactly one marker. |
| Whitespace or line-wrapped Base64 | No | Remove the wrapping at the source. |
| Base64url characters such as - and _ | No | Convert the payload to standard Base64 first. |
| Missing, surplus, or misplaced padding | No | Obtain a canonically encoded payload. |
For a data URL, the media type must use type/subtype syntax, and parameters before ;base64 must use name=value syntax. Duplicate base64 markers, a parameter after the marker, percent-encoded payloads, and non-Base64 data URLs are outside scope. The converter reports malformed input rather than guessing.
Clipboard mistakes that break Android conversions
Android copying is a common failure point, especially with pretty-printed JSON, email, chat apps, and terminal output.
- A newline or space inserted after every group is still whitespace, and the converter does not strip it.
- JSON quotation marks and escaped characters are not part of a canonical Base64 payload. Decode the JSON string at the source instead of pasting its serialized wrapper.
- Base64url uses minus and underscore for URL-safe transport. Change it to standard RFC 4648 Base64 before using this converter.
- Padding must sit only at the end. Do not add padding characters merely to make the visible string look tidier.
- Editing the pasted text clears the previous preview and download, so convert only after the final copy is in place.
If the source cannot provide canonical text, use a purpose-built Base64 text decoder to normalize it first. This focused image tool will not silently repair encoding because a successful-looking result would no longer show whether the producer emitted canonical transport data.
How the real image type is detected
A data-URL media type is metadata, not proof of the file format. The decoded bytes are checked against structural rules for each supported format before the browser tries to render them.
| Format | Required structure | Download extension |
|---|---|---|
| PNG | Complete eight-byte signature, first IHDR chunk with the mandated length, and terminal IEND boundary | .png |
| JPEG | Start-of-image bytes, a following marker, and terminal end-of-image bytes | .jpg |
| GIF | GIF87a or GIF89a signature, logical-screen descriptor, and stream trailer | .gif |
| WebP | RIFF and WEBP markers, exact RIFF byte count, and a bounded VP8, VP8L, or VP8X first chunk | .webp |
These checks reject bare or truncated magic bytes, but they do not replace image decoding. The browser must also decode the complete Blob and report positive dimensions. If a container is malformed, the conversion fails instead of showing a false success. When a data URL says image/jpeg but contains PNG bytes, the declared value is shown as ignored and the download uses .png.
When Base64 belongs inside an Android app
If you are building an Android app, use the browser converter as an inspection and recovery step, not as a runtime dependency. It has no Android library interface, and its input limits do not automatically protect code that calls Android decoding APIs.
- Keep the source payload canonical. If it is a data URL, parse the metadata separately and pass only the encoded portion to the Android Base64 decoder.
- Decode the text into bytes. In Kotlin, android.util.Base64 can turn a plain string into a ByteArray. Check that decoding succeeds before using the bytes.
- Decode the bytes into pixels. Pass the array to a platform image decoder such as BitmapFactory.decodeByteArray, and treat a null result as invalid data rather than displaying an empty image.
- Render the result. Use the decoded Bitmap in your ImageView or Compose interface. If exact container bytes matter, save the original ByteArray separately instead of treating a rendered Bitmap as an identical file.
- Choose the extension from the actual structure. Do not trust the data-URL MIME label. This mirrors the browser converter’s signature-based approach, but the app remains responsible for its own validation and memory limits.
Use a downloaded file as a test fixture, or use the converter to confirm what a producer actually sent before writing the native decoding path. The browser tool can reveal format and dimensions; it cannot compile into or execute inside an APK.
Size, dimension, and validation limits
The converter applies hard limits before it publishes a preview or download.
| Check | Allowed value | Result |
|---|---|---|
| Input text | 8,000,000 UTF-16 code units | The exact boundary is accepted; more is rejected. |
| Decoded bytes | 5 MiB, or 5,242,880 bytes | The exact boundary is accepted; more is rejected without truncation. |
| Width and height | Positive dimensions, with neither side exceeding 20,000 pixels | Any excess edge dimension is rejected. |
| Pixel area | Width times height no greater than 40,000,000 pixels | An over-budget image is rejected. |
| Browser decoding | The complete Blob must decode successfully | Corrupt or incomplete image data fails. |
The expected decoded size is calculated before the byte array is allocated. An oversized payload is never sliced, sampled, shortened, or partially decoded. A compact Base64 string can still expand into a large image surface, so both byte size and decoded dimensions matter.
Conversion preserves the decoded bytes. It does not draw the image onto a canvas, resize it, recompress it, recolor it, flatten PNG transparency, or intentionally remove metadata. A downloaded GIF can retain animation, and a PNG can retain alpha and embedded chunks present in the source. Preview behavior still depends on the current browser’s image decoder, while metadata display is outside scope.
The bytes are not uploaded to Lizely or an external conversion service. Temporary Object URLs are revoked when replaced, after a failed validation, or when the tool closes, and the decoded image stays in the active tab without being retained by the tool. Even so, avoid pasting sensitive material on a shared device. Local decoding is not malware analysis, content moderation, steganography detection, or a guarantee that unknown content is safe.
After the Android download
A successful browser validation does not repair a corrupt image, change its format, or guarantee that every gallery or Android app will accept it. If the preview is correct but the file needs to be smaller, download it first and use Image Compressor. If it needs different pixel dimensions, use Image Resizer after saving the original.
For normal website delivery, prefer an image file and an appropriate URL when possible. Base64 increases transport size and is not usually the most efficient way to store large images. This converter is best suited to inspection, recovery, debugging, and handing off data that is already encoded.
On Android, keep the downloaded file until the destination app has opened it. Moving it to a shared album, sending it in a message, or attaching it to a form is an Android file-management step; successful conversion does not automatically perform those actions.
If you're weighing options, GIF Maker on Android: Make GIFs in Your Browser covers this in detail.
If you're weighing options, Image to Base64 for Email Attachment: MIME Steps covers this in detail.