Image to Base64

NEW

Convert any image to Base64 string

FreeNo sign-upImage Tools →

Image to Base64 encodes an image file as a Base64 text string, the form needed to embed an image directly inside HTML, CSS or JSON without a separate file request. Upload an image and switch between four ready-made outputs: the raw string, an HTML img tag, a CSS background-image rule, and a JSON value.

The tool shows the original size next to the encoded size, which is about a third larger. That overhead is why inlining suits small icons and placeholders better than large photos.

Advertisement

How to use Image to Base64

1

Upload an image

Any image type works.

2

Choose a snippet type

Raw, img tag, CSS or JSON.

3

Copy

Paste the snippet into your code.

Use Cases

  • Embedding a small logo in an HTML email
  • Inlining an icon in a stylesheet
  • Sending an image through a JSON API

Frequently Asked Questions