Convert Image to Base64 Online

Turn any image into a Base64 data URI you can paste into HTML, CSS, JSON or an email template. The file is encoded in your browser.

  • No upload, 100% local
  • No signup or watermark
  • Works on phone and desktop

How to use the image to base64

  1. Choose your image.
  2. Press the button.
  3. Copy the Base64 string.

When to use Base64 images

Inline images avoid an extra network request, which suits tiny icons, email signatures and single-file demos.

Size warning

Base64 text is about one third larger than the original file. Use it for small images only and keep large pictures as normal files.

Encode PNG, JPG and WebP to Base64

The output is a data URI such as data:image/png;base64,... that you can drop straight into code.

Use Base64 images in HTML and CSS

  • HTML: put the string in an img src
  • CSS: use it inside url() for backgrounds
  • JSON or email templates: embed small icons

When not to use Base64

Large images make HTML heavy and slow. Keep photos as normal files and encode small icons only.

Frequently asked questions

What is a data URI?

A string beginning with data:image that contains the image itself.

Is the original file changed?

No. It is only read and encoded.

Can I use it in CSS?

Yes, in a url() value for backgrounds.

How do I convert an image to Base64?

Upload, press Convert to Base64, then copy.

Is Base64 encryption?

No. It is simply text encoding and is easy to reverse.

Why is the string so long?

Base64 adds about 33% to the size.

Can I decode it back?

Yes with any Base64 decoder.

Related tools