Check whether the receiving field expects a URL or raw Base64
You need to place a small image into a field that accepts encoded image data, or reproduce an image-handling problem without a separate attachment. First check whether the field expects a complete Data URL or only its Base64 payload. Those are related strings, but they are not interchangeable in every application.
A complete result can begin with data:image/png;base64, followed by the encoded file. The prefix identifies the media type and encoding; it is not part of the PNG's binary bytes. Do not add quotation marks or surrounding document markup unless the receiving format requires them.
Encode a controlled copy and decode the result
A wrapped display line is not necessarily an extra character in the underlying text. If another application truncates the string, adds punctuation or changes its contents, inspect the actual text you pasted rather than trusting how a shortened preview looks.
- Open Image to Base64 and choose the source image. For the public example, use the supplied 96 × 64 PNG.
- Read the generated output. Use Copy Data URL when the destination expects the complete prefix and payload, or Copy raw Base64 when it explicitly expects only the payload.
- For a round-trip check, open Base64 to Image and paste the complete Data URL. Wait for the image preview and file information.
- Download the decoded image and reopen it. Check its actual format and dimensions rather than assuming a filename establishes the type.
- When exact file identity matters, compare the recovered bytes or a file hash with the original. For this public sample, the decoded file is byte-for-byte identical to the source.
Count the public PNG and its encoded representation
The authored PNG is 355 bytes. Its raw Base64 payload is 476 characters, and the data:image/png;base64, prefix adds 22 characters, giving 498 characters for the complete saved text. These sample characters are ASCII, so this TXT also occupies 498 bytes.
Decoding that payload returns the same 355 PNG bytes and the same 96 × 64 image. The larger text representation is expected: Base64 groups binary data into printable characters, with padding when needed. It is not a smaller image export, even though a destination may find the single text value convenient.
| Representation | Bytes / characters | Check |
|---|---|---|
| Source PNG | 355 bytes | 96 × 64 pixels |
| Raw Base64 | 476 characters | No Data URL prefix |
| Complete Data URL | 498 characters | 22-character prefix included |
| Decoded PNG | 355 bytes | Exact source bytes |

Check format and contents independently of the label
The decoder checks the image's recognised byte signature rather than relying only on the declared prefix. If the label and image data disagree, review the reported format and use a correctly identified file. Changing the MIME label does not convert JPEG bytes into PNG bytes.
The encoder reads the chosen file rather than resizing or redrawing it. Recovering those bytes can therefore recover information already stored in that file as well as the visible picture. Only encode content you intend the recipient to reconstruct; encoding is not encryption or metadata removal.
When a normal image attachment is more practical
A large photo can become a long text value that is inconvenient to copy, inspect or store in a form. Check the receiving application's length limits and supported media types. If it accepts an ordinary image attachment or URL, that may be the more practical deliverable.
Keep the original file and the complete approved text until the receiving application has accepted it. An image preview checks decodability and appearance; it does not by itself prove that every original byte was retained. The exact round trip described here is verified for the public sample.