# Image to Base64

> Convert images to Base64, a data URL, an <img> tag or a CSS background-image, with the size increase shown. Several files at once; nothing is uploaded.

- URL: https://www.tooljig.com/image-to-base64
- Category: [Converters](https://www.tooljig.com/category/converters.md)
- Runs: In the browser; nothing uploaded
- Price: free, no account needed

## What it does

Choose or drop one or more images to get their Base64 encoding in the form you need: the bare Base64 string, a data: URL, a ready-to-paste <img> tag with the width and height filled in, or a CSS background-image declaration. Each file shows its original size, the encoded size and the growth, which is about a third because Base64 spends four characters on every three bytes. The images are read in your browser and stay on your device.

## How to use it

1. Choose or drag in one or more images.
2. Pick the output: data URL, Base64 only, <img> tag or CSS.
3. Copy the result for each image.

## Good to know

- Base64 is about 33% larger than the file, plus up to two padding characters, and inlined images cannot be cached separately; a warning appears above 100 KB, where a normal image file is usually the better choice.
- The MIME type comes from the file's own bytes when it is a known image format, so a mislabelled file still gets the right data: URL. Files up to 25 MB are accepted.

## FAQ

### When is inlining an image as Base64 a good idea?

For small icons and images under a few kilobytes, where saving an HTTP request matters more than the size increase, or when a single self-contained HTML file or email is needed.

### Why is the Base64 version bigger?

Base64 represents every 3 bytes with 4 text characters, so the result is 4/3 of the original size, rounded up to a multiple of 4 characters.

### Are my images uploaded?

No. Encoding happens in your browser with the files you select; nothing is sent to a server.

## Related tools

- [Base64 to Image](https://www.tooljig.com/base64-to-image.md): Paste a data URL or Base64 string to preview the image, detect its real type from the bytes, see its size and dimensions, and download it as a file.
- [Base64 Encode / Decode](https://www.tooljig.com/base64-encode-decode.md): Encode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe option. Private and instant.
- [Compress Image](https://www.tooljig.com/compress-image.md): Reduce image file size with smart, adjustable compression.
