Image to Base64 Converter and Decoder

Embed small images directly in HTML, CSS or JSON by converting them to Base64. You can also paste a Base64 string or data URI to preview the image and download it as a file.

Image → Base64

Base64 → Image

How to use it

  1. Choose an image to get its Base64.
  2. Select the output style: data URI, raw Base64, CSS or HTML tag, then copy.
  3. To decode, paste Base64 in the lower box and press Decode.

Example

A 1 KB PNG icon becomes about 1.4 KB of Base64 text that you can paste into a CSS background-image rule.

Benefits

  • One-click snippets for CSS and HTML.
  • Decoder detects common image types from the data.

Limitations

  • Base64 is about 33 percent larger than the file and is not cached separately, so use it only for small images.
  • This is encoding, not encryption.

Frequently asked questions

When should I use Base64 images?

For tiny icons or email templates. Larger images load faster as normal files.

Is my image uploaded?

No. Encoding happens locally.

Related tools