Image to Base64

Image to Base64

Encode a two-pixel PNG as a Base64 data URL.

Maximum upload file size: 5 MB

Use Remote URL
Upload from device

Try this example

Download and upload the sample, convert it, and compare the result with the string below.

2 × 1 · PNG

Download sample image

Expected result

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAD0lEQVQImWN4ZmOjkfcMAAnBAtuPdGM6AAAAAElFTkSuQmCC

The data URL holds a copy of the original bytes and can be pasted into Base64 to Image.

Related walkthrough · Resize, crop and convert a web image without stretching it

Cookie
We care about your data and would love to use cookies to improve your experience.

Learn how we use cookies