Developer Tools

Image to Base64

Convert an image to a Base64 string or data URL for HTML, CSS and JSON.

Runs in your browser: nothing you enter is uploaded

Drop an image here

Get a Base64 string or data URL you can paste into HTML, CSS or JSON.

Your image stays private. It is encoded in your browser and never uploaded.

How it works

1

Add an image

Drop a PNG, JPG, GIF, WebP or SVG image.

2

Pick the format

Data URL, plain Base64, an HTML img tag or CSS background.

3

Copy it

Copy the code and paste it into your HTML, CSS or JSON.

Image to Base64 features

  • Data URL, raw Base64, HTML and CSS formats.
  • Shows file size before and after encoding.
  • Works with PNG, JPG, GIF, WebP, SVG and ICO.
  • Preview of the image.
  • One click copy.
  • Private: nothing is uploaded.

Image to Base64 FAQ

What is a Base64 image?

It is the image file written as text, so it can be placed directly inside HTML, CSS or JSON without a separate file.

Does Base64 make images bigger?

Yes, about 33% bigger. It is best for small images like icons and logos.

Can I use it in emails?

Some email apps block Base64 images. A hosted image link is more reliable for email.

Is my image uploaded?

No. It is encoded in your browser.

Related Developer Tools

Recent from the blog