Image to Base64
Encode a two-pixel PNG as a Base64 data URL.
Try this example
Download and upload the sample, convert it, and compare the result with the string below.
2 × 1 · PNGExpected result
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAD0lEQVQImWN4ZmOjkfcMAAnBAtuPdGM6AAAAAElFTkSuQmCCThe data URL holds a copy of the original bytes and can be pasted into Base64 to Image.
Related walkthrough · Resize, crop and convert a PNG for the web
DTool Team
Product Team
We build simple, reliable browser tools that make everyday digital work faster.