Verify a Base64 file round trip with SHA-256
Compare the original and restored PNG by byte count and digest. An identical filename or thumbnail can hide a difference in the underlying files.
Set aside two separate files
Download the original PNG and its Base64 text below. Run the text file through Decodex file decoding and save the download as restored.png next to the original. Separate names make it easy to tell which copy you tested even if your browser adds a download suffix.
Read both PNGs as bytes
Run this Python snippet in the directory containing the pair. Each row shows the name, length and SHA-256. For this fixture both lengths are 81 and both digests are 770b5f0399029e2b88b5421d1ac2a7ef375d8dcce3c97bc956200367d750d0dc.
from pathlib import Path
from hashlib import sha256
for name in ("sample-grid.png", "restored.png"):
data = Path(name).read_bytes()
print(name, len(data), sha256(data).hexdigest())Interpret a difference
A length near 108 suggests that you may have hashed the Base64 text itself. Matching lengths with different digests indicate that some bytes differ. Restart from the original file bytes and keep them out of text editors that can change line endings or character encoding.