Encoding

Base64 Image Converter

Convert PNG, JPEG, WebP, GIF, and AVIF images to Base64 data URLs and back locally in your browser.

Runs locally in your browser
Drop an imageCreates a Base64 data URL locally. Supported: PNG, JPEG, WebP, GIF, AVIF.

Choose an image or paste Base64. Everything stays in your browser.

How to use this tool

Drop an image file to convert it into a Base64 data URL.

Paste a Base64 image data URL to decode it back into a downloadable image file.

Use this for small inline images, test fixtures, CSS examples, and quick debugging, not for large production media libraries.

Image data URLs explained

A data URL combines the media type and encoded bytes in one text string, for example `data:image/png;base64,...`.

This can be useful for tiny icons, documentation snippets, email templates, and tests where a separate file is inconvenient.

Base64 data is usually larger than the original binary file, so inline images can hurt performance if overused.

Base64 is not image protection

Base64 does not hide or encrypt an image. Anyone with the string can decode it back into a file.

Do not encode private images, IDs, or screenshots and assume they are protected.

For production sites, prefer normal optimized image files unless there is a clear reason to inline a tiny asset.

Examples

Tiny PNG data URL

The prefix tells browsers the decoded bytes are a PNG image.

Input
data:image/png;base64,iVBORw0KGgo...

CSS background image

Output
background-image: url("data:image/svg+xml;base64,...");

FAQ

Should I inline large images as Base64?

Usually no. Base64 increases size and can make caching worse. Use it for small assets or tests, not large images.

Is Base64 image data private?

No. It is reversible encoding. Anyone with the data URL can decode the image.

Why does the output start with data:image?

That prefix is the data URL metadata. It tells software the media type and encoding before the Base64 payload.

Is the image uploaded?

No. Encoding and decoding run locally in your browser.