Image to Base64 Converter

Encode an image as Base64 to embed it directly in HTML, CSS or JSON, or decode a Base64 string back into a picture you can download.

Image to Base64 ConverterPrivate
Image to Base64
Drop an image herePNG, JPG, GIF, WebP or SVG

Base64 to image

Runs in your browser. Your data is never uploaded to any server.

How to use the image to base64 converter

  1. To encode, drop an image into the box. You get the data URL and ready-made HTML and CSS.
  2. Click the button for the format you need to copy it.
  3. To decode, paste a Base64 string or data URL in the second box and click Show image.

When to use Base64 images

A data URL lets you place a small image directly inside HTML, CSS, JSON or an email without a separate file. This saves a request and is handy for tiny icons and logos. Base64 makes data about 33% bigger, so it is not a good idea for large photos.

Frequently asked questions

How do I convert an image to Base64?

Drop the image into the first box. The Base64 string and data URL appear and you can copy them.

How do I use a Base64 image in HTML?

Copy the HTML img tag and paste it into your page. The image is embedded with no extra file.

How do I turn Base64 back into an image?

Paste the string in the second box and click Show image, then download it.

Is my image uploaded?

No. Everything happens in your browser.