CraftTools

Image to Base64 Converter

Guide: Base64 Explained: What It Is and When to Use It

Drag an image here, or

Nothing you enter or choose here leaves your device. This tool runs in your browser.

How to use

  1. 1Drag an image into the box, or click to choose one.
  2. 2See a preview with the file size.
  3. 3Copy the data URI, the Base64 text, the CSS or the HTML tag.
  4. 4To go the other way, open Base64 to Image, paste Base64 and download the picture.

Frequently asked questions

When should I use a Base64 image?

For very small images, such as icons under about 10 KB, to save a network request. Large images become about a third bigger as Base64 and can't be cached on their own, so link to them instead.

Is my image uploaded?

No. The image is read in your browser and never leaves your device.

What is a data URI?

A way to put a file directly in a web address, such as data:image/png;base64,iVBOR... You can use it in an <img> src or in CSS.

Which formats work?

Any image your browser can read, including PNG, JPEG, GIF, WebP, SVG and ICO, up to 10 MB.

Read the guides

Learn how this works and how to get the most from it.

Developer

Base64 Explained: What It Is and When to Use It

How Base64 encoding works, why it makes data 33% larger, where it is used (data URIs, JWTs, email) and why it isn't encryption.

1 min read

Images

PNG vs JPG vs WebP: Which Image Format Should You Use?

A plain-English comparison of PNG, JPG and WebP: file size, transparency, quality, and which one fits photos, logos and screenshots.

2 min read

SVG Optimizer

Make SVG files smaller by removing the extras editors add.

Image Converter

Convert between PNG, JPG and WebP in your browser.

Base64 & URL Encoder / Decoder

Encode and decode Base64 and URL-encoded text instantly.

Image Compressor

Make JPG, PNG and WebP images smaller. Private, in your browser.