The fix: Delete the data URL header. That is everything from data: up to and including the first comma. Paste only the Base64 text that follows it into From Base64. To see the picture, add Render Image directly after From Base64 and set its input format to Raw. Do not put To Hex between the two operations.
If you pasted a whole data:image/png;base64,... string into CyberChef and got gibberish, the decoder did not malfunction. It decoded the header as well. The sections below show what I measured, why it happens, and how to confirm the bytes are correct.
What I tested, and the sample payload
I tested on 23 November 2026 in Chrome on Windows. I used the offline CyberChef 11.6.0 build from the official GCHQ release ZIP, served over localhost with external requests blocked. Playwright drove the real browser interface.
Every test began with a double-click on From Base64 and kept its defaults:
- Alphabet:
A-Za-z0-9+/= - Remove non-alphabet chars: checked
- Strict mode: off
- Auto Bake: on
To inspect the result, I added To Hex after From Base64 and read the hex in the output pane.
The test image is a 32 by 16 RGB PNG, blue on the left half and yellow on the right, 102 bytes long. Its Base64 encoding is 136 characters:
iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAALUlEQVR4nGNUjtrNQAq4U9pKknomBhoDplELCIHRICIIRoOIIBgNIoJg6AcRAI6BAy7MdQhxAAAAAElFTkSuQmCC
Because 102 divides evenly by three, this payload ends without = padding. That is a property of this particular file, not a general rule.
Four runs compared
| Input pasted | Characters | Decoded bytes | First eight bytes | Outcome |
|---|---|---|---|---|
| Bare payload | 136 | 102 | 89 50 4e 47 0d 0a 1a 0a | Matches original |
| Payload with a line feed every 32 characters (4 breaks) | 140 | 102 | 89 50 4e 47 0d 0a 1a 0a | Identical to original |
| Full data URL | 158 | 116 | 75 ab 5a 8a 66 a0 7b fa | Not a readable PNG in Pillow |
| Bare payload restored | 136 | 102 | 89 50 4e 47 0d 0a 1a 0a | Matches original again |
I repeated the data URL case in a second GUI run and got the same result. The correct output and the line-wrapped output both have SHA-256 751b7538c5996a69e427fb9c0ccd0b5f8aea5db9ffe7cc21e25c8b404f89e297.


Why removing non-alphabet characters does not parse a data URL
Remove non-alphabet chars is a filter, not a parser. It discards characters outside the selected alphabet, such as line breaks. That is why the wrapped payload decoded perfectly.
The filter does not know what a data URL is. In data:image/png;base64,, only the colon, the semicolon and the comma fall outside the alphabet. The letters, the digits and the slash in image/png are all valid Base64 symbols, so they survive.
That leaves 19 extra characters, dataimage/pngbase64, attached to the front of the real payload. This causes two problems:
- The header decodes into bytes of its own. The characters
databecome75 ab 5a, which is exactly where the wrong output begins. - The real payload is shifted out of alignment. Base64 decodes in groups of four characters, and 19 is not a multiple of four. Every group from the genuine payload is now split across a boundary.
So the damage is not limited to a few leading bytes. The whole output is misaligned, which is why 158 characters turned into 116 bytes that no longer form a PNG.
Step by step: decode and preview the PNG
- Copy the data URL and delete the header, from
data:through the first comma inclusive. Do this only after reading the header and confirming it declares;base64. Do not cut arbitrary leading text from other kinds of input. - Start a fresh recipe and double-click From Base64. Keep the default alphabet, leave Remove non-alphabet chars checked, and leave Strict mode off.
- Paste the remaining Base64 into the input pane. Line breaks inside it are fine because they are filtered out.
- Add Render Image directly after From Base64 and set its input format to Raw.
- With Auto Bake on, the output pane shows the picture. In my run it displayed the original 32 by 16 image, blue on the left and yellow on the right.

If you added To Hex to inspect the bytes, take it out of the preview recipe. To Hex replaces the bytes with text that describes them, so Render Image would receive hex characters instead of image data. Treat hex as a diagnostic branch, not as part of the path that carries the image.
Three distinct checks and what each proves
Each check answers a different question, so keep them separate:
- First-eight-byte test. A PNG begins with
89 50 4e 47 0d 0a 1a 0a. This check is fast and immediately exposes the data URL mistake, which starts with75 ab 5a 8a 66 a0 7b fa. It only shows that the output starts like a PNG, not that the rest is intact. It applies to PNG only. Other formats have different signatures, and I did not test them. - Full digest equality. Compare the SHA-256 of the decoded bytes with the SHA-256 of a trusted original. A match proves the two are byte-for-byte identical. Without a trusted reference, this check has nothing to compare against.
- Pixel test. Open both files with an image library and compare their RGB values. This proves the decoded file shows the same picture, which is what matters for previewing.
An optional verification snippet
You do not need Python just to view the image, because CyberChef renders it. This snippet is for independently confirming the hex you read from To Hex. It needs Python 3.8 or later and Pillow. Paste the To Hex output between the triple quotes, replacing the placeholder line.
import base64, hashlib, io
from PIL import Image
PAYLOAD = ('iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAALUlEQVR4nGNUjtrNQAq4'
'U9pKknomBhoDplELCIHRICIIRoOIIBgNIoJg6AcRAI6BAy7MdQhxAAAAAElFTkSuQmCC')
HEX_FROM_CYBERCHEF = '''
paste the To Hex output here
'''
reference = base64.b64decode(PAYLOAD)
candidate = bytes.fromhex(HEX_FROM_CYBERCHEF)
print('decoded length:', len(candidate))
print('1. first eight bytes:', candidate[:8].hex(' '),
candidate[:8] == bytes.fromhex('89504e470d0a1a0a'))
digest = hashlib.sha256(candidate).hexdigest()
print('2. SHA-256:', digest, digest == hashlib.sha256(reference).hexdigest())
try:
a = Image.open(io.BytesIO(reference)).convert('RGB')
b = Image.open(io.BytesIO(candidate)).convert('RGB')
print('3. pixels match:', a.size == b.size and a.tobytes() == b.tobytes())
except Exception as exc:
print('3. Pillow could not open the bytes:', type(exc).__name__)
Based on the runs above, here is what to expect:
- Bare payload: 102 bytes, and all three checks should pass.
- Full data URL: 116 bytes, a different signature and a different digest. Pillow did not open these bytes as a PNG in my verification, so the third check cannot report a match.
Limits of this article
I tested only this PNG, with the standard alphabet, Strict mode off and a small input. I did not test other image formats, URL-safe alphabets, Strict mode or large inputs.
Saving the output to a file is outside the scope of this article. Clicking the save control did not produce a browser download I could verify, so I give no save instructions here.
Nothing here is a security claim. Decoding an image does not make its content safe.


