Developer Tool · In Your Browser

Image ↔ Base64 Converter — Free Online Tool

Encode an image to a base64 string for inlining into code, or decode a base64 string back to an image. One-click copy, usage examples, fully local, no upload.

Drag an image here, or click to select
Encode to base64 locally · No upload
Select Image
Works on desktop, tablet & mobileNo upload — stays on your deviceNo watermarkLocal processing
Quick answer

Base64 is a way to encode binary image data as a plain-text string. It is commonly used to inline small icons directly into HTML, CSS, or JS to save a network request. This tool supports image-to-base64 encoding (with usage examples and one-click copy) and base64-to-image decoding. Processing runs entirely in your browser — no upload required.

When

When to Use Base64

Inline Small Icons

Embed a small logo or icon directly into CSS / HTML to eliminate an extra request.

Embed in Code or Config

Put an image directly into your code when referencing an external file is not an option.

Decode and Preview

Got a base64 string? Quickly decode it to preview and download the image.

Note

Important Notes

Avoid Using Base64 for Large Images

Base64 increases file size by about 33% and prevents the browser from caching the image independently. It is suited for small icons; large images should still be referenced as regular image files.

The String Can Be Very Long

The larger the image, the longer the base64 string. This tool provides one-click copy to avoid manually selecting extremely long text.

Related

Related Tools

FAQ

Base64 FAQ

Yes. Encoding increases the size by about 33%. Use it for small icon inlining; large images are better served as regular files.

Both strings with and without the data:image/...;base64, prefix are supported. Invalid or truncated strings will show an error.

No. Encoding and decoding run entirely in your browser.

Some browsers restrict automatic clipboard access in non-secure contexts. You can manually select all the text in the output box and copy it.