Base64 Image Encoder

By the ToolPocket team · Updated 2026-12-05 · Editorial standards

A data URL embeds a file directly in CSS, HTML or JSON, removing a separate request. For small icons and placeholders that is convenient; for photographs it bloats the document, because Base64 is about a third larger than the binary.

Encode an image file to a data URL, or paste a data URL (or raw Base64) and decode it back into a downloadable image. Nothing is uploaded.

Download image

Runs locally in your browser — nothing is uploaded.

How to use the Base64 Image Encoder

  1. Choose an image file to encode, or paste a data URL to decode.
  2. Copy the data URL, or download the decoded image.

Frequently asked questions

When should I use a data URL?

Small assets that are needed immediately and cached with the document: icons, logos, tiny placeholders. Avoid it for anything large.

Why is the string so long?

Base64 encodes three bytes as four characters, so the result is about 33% larger than the file, plus the data URL prefix.

Can I decode any Base64?

The payload must be an image format the browser can display (PNG, JPEG, WebP, GIF, SVG). Arbitrary Base64 will not render.

Good to know

Data URLs remove a request but move the bytes into the document, where they cannot be cached separately and are re-downloaded with every HTML response. That trade is worth it for a small logo and a bad deal for a hero photo.

SVG can be embedded either as a data URL or inline; inline SVG can be styled with CSS and is usually smaller. For raster icons, an SVG favicon or a separate file is often the better long-term choice.