What a Base64 image is and when to use one
A Base64 image is the file’s binary data rewritten as printable ASCII text, usually wrapped in a data URI like data:image/png;base64,iVBORw0…. Because it is plain text, the image can live directly inside an HTML attribute, a CSS rule or a JSON payload — no separate file, no extra HTTP request. That makes Base64 ideal for small icons, email signatures and single-file HTML documents, and a poor fit for photos: the encoding adds roughly 33% to the size and the result can’t be cached independently of the page. For the mechanics of the encoding itself, see our guide What is Base64?.
How to convert an image to Base64
- Choose Image → Base64 and drop, browse or paste an image.
- The tool reads the original bytes — no re-encoding — and shows the data URI, the raw Base64, and ready-to-paste HTML and CSS snippets.
- Copy whichever form you need; the size strip shows exactly how much the encoding added.
The reverse direction works too: paste a data URI or a bare Base64 string into Base64 → Image and the tool detects the format (PNG, JPEG, GIF or WebP) from the data itself, renders a preview and lets you download the file.
Keep inlined images small
Every kilobyte you inline is re-downloaded with the page that contains it, so the tool warns when output passes 100 KB. If your image is that large, shrink it first with the Image Compressor or convert it to a more efficient format with the Image Converter — then inline the smaller result, or simply serve it as a normal cached file.