Image to Base64
Represent the exact bytes of a tiny PNG as a data URL.
Represent the exact bytes of a tiny PNG as a data URL.
How to use
- Download the 2 × 1 PNG example and upload that saved file.
- Convert the file and copy the entire data URL, including its prefix.
- Compare it with the reference output, or decode the copy back to an image.
Worked example
Input · DownloadInput
2 × 1 · PNGExpected result
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAD0lEQVQImWN4ZmOjkfcMAAnBAtuPdGM6AAAAAElFTkSuQmCCCheck the result
The output should start with data:image/png;base64, and the decoded image should measure 2 × 1.