SSquoosh Pro

Image to Base64

Drop an image below to generate a data URI you can paste into code or API requests.

Drop an image here or click to browse Any image format your browser can read.
No image encoded yet.

Base64 to image

Paste a full data URI or a raw Base64 string into the box, then decode and preview it.

Waiting for Base64 input.

When to use Base64 images

Base64 encoding converts binary image data into text that can be embedded directly in HTML, CSS, JSON, and API payloads. It is useful for small assets that must travel with the code, for prototypes, for email-safe images, and for scenarios where a separate image request is impractical.

Advantages and limitations

Advantage Limitation
No extra HTTP request for the image The data URI is about 33% larger than the binary file
Works inside single-file HTML documents Cannot be cached separately by the browser
Convenient for API and JSON workflows Large strings make code harder to read and maintain

When to avoid data URIs

For production websites, large embedded images can slow down the initial HTML or CSS download. A data URI cannot be cached independently, so it is downloaded every time the document changes. If an image is larger than a few kilobytes, a normal file URL with caching headers is usually a better choice.

Best practice: Use Base64 for tiny icons, inline SVG examples, or temporary test payloads. For full-size website assets, serve a compressed file with caching and responsive attributes.

Frequently asked questions

Why is the Base64 string longer than the original image?

Base64 uses 64 printable characters to represent binary data, so it needs about 4 characters for every 3 bytes of input. That adds roughly 33% to the size.

Can I paste a raw Base64 string without the data: prefix?

Yes. The decoder detects a plain Base64 string and tries to identify a suitable MIME type from the file signature.

Is the encoded image uploaded anywhere?

No. Encoding and decoding happen entirely in your browser with the FileReader and Blob APIs.

Related tools

Compress an image first with the image compressor so the Base64 string is shorter, or inspect its technical details with the image info viewer.