Skip to content
Zoyku

Base64 Image

Convert images to base64 data URLs and back — preview, validate and download, with an exact size comparison. Everything runs in your browser.

Drop a file here or click to choose

This tool runs entirely in your browser. Your data never leaves your device — it is not uploaded to any server.

How to use

  1. 1Drop an image into the panel (or paste one from the clipboard) to encode it.
  2. 2Copy the data URL — or just the base64 payload — and check the size comparison before inlining.
  3. 3Switch to the decode tab, paste any image data URL, then preview or download it.

Base64 Image

Drop in a PNG, JPEG, GIF, WebP or SVG and get a ready-to-paste data:image/…;base64,… URL for inline CSS, HTML or JSON payloads. The tool shows the original file size next to the resulting text size, so you can see the ~33% base64 overhead before you commit to inlining.

Paste a data URL and the reverse view decodes it: the image is previewed, the declared MIME type is checked against the actual bytes, and a download button saves it back to a file. Invalid base64 or a non-image type fails with a clear message instead of a broken preview.

Frequently asked questions

When is it worth inlining an image as a data URL?

For small icons, avatars and loading placeholders. Base64 makes text ~33% larger than the binary file, so below a couple of kilobytes you usually save an HTTP request overall; for photos the overhead almost always outweighs the benefit.

Why is the base64 version bigger than my file?

Base64 encodes every 3 bytes as 4 text characters — a fixed 33% inflation, plus the data:image/…;base64, prefix. Nothing is compressed or lost; it is simply a text-safe encoding of the same bytes.

Which formats can the decoder handle?

Anything your browser can render as an image: PNG, JPEG, GIF, WebP, SVG, BMP, AVIF and more. The tool verifies that the payload is valid base64, that the declared MIME is an image type, and warns you when the file's magic bytes don't match the declared type.

Embed this tool

Put this tool on your own site with one line — it runs entirely in the visitor's browser.

<iframe src="https://zoyku.com/en/tools/base64-image?embed=1" width="100%" height="640" style="border:0;border-radius:16px" title="Zoyku — base64-image" loading="lazy"></iframe>
100% local processing