When you encounter a seemingly infinite block of random alphanumeric characters starting with iVBORw0KGgo..., you are looking at a Base64 encoded image. Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format.
What Does the Decoder Actually Do?
A standard Base64 decoder performs a mathematical reversal of the encoding process. Every 4 characters of the Base64 string represent 3 bytes of standard visual data (the actual pixels of the JPG or PNG). The browser reads the string, converts those ASCII characters back into 8-bit bytes, and constructs a visual file.
Dealing with Data URIs
A raw Base64 string is just raw data. To tell a web browser how to display that data, the string is often prepended with a Data URI scheme. A complete HTML-ready string looks like this:
data:image/png;base64,iVBORw0K...
If you paste a string into our decoder that is missing this header, our tool intelligently attempts to identify the file signature (the "magic numbers" at the start of the binary) to successfully render the image anyway.