What is Base64 and when should you embed images with it?
Base64 is a way of writing binary data, such as the bytes of a PNG file, using only 64 safe text characters. Once an image is encoded, it can live directly inside HTML, CSS, JSON, XML or an email template as a data URI like data:image/png;base64,iVBORw0…. The browser decodes it on the fly, so the image appears without a separate network request.
Good reasons to use Base64 images
- Small icons and logos in CSS or HTML, where saving a request matters more than a few extra bytes.
- HTML email signatures and templates that must show images even when remote content is blocked.
- Single-file demos, offline pages and code playgrounds where you cannot host files.
- APIs and JSON payloads that need to send an image inside a text field.
When not to use it
Base64 makes data about 33% larger, and an inline image cannot be cached separately from the page or stylesheet that contains it. For photos and anything over roughly 10–20 KB, a normal image file is usually faster. If you must embed something larger, shrink it first with the Image Compressor or convert it to WebP with the Image Converter; SVG icons often encode smallest of all.
Decoding Base64 back to an image
Found a long data:image string in a web page, an API response or a database? Paste it into the decoder tab. The tool cleans up whitespace and line breaks, detects the real image type from the first bytes, shows a preview and lets you download the file with the correct extension. Developers in India and the US use it to debug uploads, inspect email templates and recover images from exported data, all without sending anything to a server. URL-safe Base64 and strings split across many lines are handled automatically.