# Image ↔ Base64 Converter

> Convert images to Base64 data URIs and decode Base64 back to images. Batch drag & drop, paste support, raw/data-URI/<img>/CSS output — all in your browser.

- URL: https://bytescope.dev/en/image-base64/
- Locale: en · Also: [ja](https://bytescope.dev/ja/image-base64.md) · [zh-Hant](https://bytescope.dev/zh-Hant/image-base64.md)
- Runs: Your files never leave your browser — all processing is local.
- Requires: Any modern browser (Chrome, Edge, Firefox, Safari), desktop and mobile.
- Updated: 2026-09-08

## What it does

This converter turns image files into Base64 strings you can embed directly in HTML, CSS, JSON or source code — and turns Base64 strings back into downloadable images. Drop, browse or paste any number of images; each one gets a card with four ready-to-copy formats: the raw Base64 payload, a complete `data:` URI, an HTML `<img>` tag and a CSS `background-image` rule.

Decoding is just as forgiving: paste raw Base64 with or without the data URI prefix, wrapped across lines, or several blobs at once — the tool splits them, detects the real image format from magic bytes and gives you a preview plus a download button.

## Limits

Does not compress or resize images, and does not decode non-image data URIs.

## FAQ

### Are my images uploaded to a server?

No. The conversion runs entirely in your browser using JavaScript — files never leave your device. You can even use this page offline once it has loaded.

### Why is the Base64 output larger than my image?

Base64 represents every 3 bytes of binary data as 4 text characters, so the output is always about 33% larger than the original file. It's a size trade-off for being able to embed binary data inside text formats like HTML, CSS or JSON.

### When should I use a Base64 data URI instead of an image file?

Data URIs make sense for small images (icons, logos, tiny previews under a few KB) where saving an HTTP request matters more than file size. For large photos, a normal image URL is almost always better — it can be cached separately and doesn't bloat your HTML or CSS.

### Which image formats are supported?

Anything your browser can read: PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF. When decoding, the format is auto-detected from the file's magic bytes, so you don't need to know what the Base64 contains.

### Can I convert multiple images at once?

Yes — drop or paste any number of images and each gets its own card with copy options. You can also paste several Base64 blobs or data URIs together and they are split and decoded automatically.
