Email clients often block external images until the reader allows them, so your logo shows up as an empty box. One workaround is embedding the image in the HTML itself. The Image to Base64 Converter produces the data URI you need.
Image to Base64 Converter FREE online toolRuns in your browser. No sign-up, nothing to install. Open the tool →What a data URI is
A data URI contains the image bytes encoded as text, in the form data:image/png;base64, followed by a long string. You place it in the src attribute of an img tag, and the image is part of the HTML, so there is nothing to download.
Base64 makes the data about a third bigger than the original file, so this suits only small images.
Convert and embed
- Pick a small image, ideally a logo or icon under about 10 kilobytes.
- Drop it into the Image to Base64 Converter.
- Copy the data URI that is produced.
- Paste it into the src attribute of your img tag.
- Add width, height, and alt attributes.
- Send yourself a test email and open it in several clients.
Limits in email
Support for data URIs in email is uneven. Some desktop clients display them, while others, including major webmail services, strip or block them, and Gmail is a well-known case. Some clients also clip messages that exceed a certain size, which a large Base64 string can cause.
The more reliable approach is attaching the image with a content ID and referencing it, or hosting the image on your own server and linking to it. Test your own audience's clients before committing.
When Base64 is a good choice
- Tiny icons or logos inside a single HTML file you will send around.
- Standalone documents that must work offline.
- Reports or invoices saved as one file.
- Prototypes and demos.
- CSS backgrounds for very small images.
When to avoid it
Do not inline photos or banners. A 200 kilobyte image becomes about 270 kilobytes of text and bloats the HTML. Email clipping, slower loading, and no browser caching are the trade-offs. Cache matters for web pages too: an external image is downloaded once and reused, while an inline one is downloaded again with every page.
A tiny example
A 1 kilobyte PNG icon becomes roughly 1.4 kilobytes of text, a trivial cost. A 100 kilobyte photograph becomes roughly 135 kilobytes of text inside your HTML, which is not. This simple comparison is a good way to decide which images are worth inlining. Compress with an image tool first, then convert.
Also remember that embedded images cannot be updated without editing the HTML, so a changed logo means resending the message.
Embedding in CSS
The same data URI works in a stylesheet as a background image, for example background-image: url(data:image/svg+xml;base64,...). For tiny decorative icons, that removes a request. Keep an eye on the size of the stylesheet, since it blocks rendering.
Preparing the image
Shrink the dimensions to what you really display, and use PNG for logos or SVG for simple icons. Also set the alt text, because many readers will see it if the image is blocked. A short text fallback such as the company name keeps the message meaningful either way.
Comments (0)
No comments yet. Be the first to share a thought.