Your Base64
-Very long - the box shows the start. Copy and Download always give the full text.
Your images
0 images - click one to show its code.
Turn PNG images into Base64 - a data URI, CSS, an HTML img tag or JSON - and see exactly how much bigger the text gets. Got Base64 instead? Decode it back to an image in the second tab. For icons, try ICO to Base64.
Very long - the box shows the start. Copy and Download always give the full text.
0 images - click one to show its code.
Want to see it first? Press Try a sample icon - a 64 px icon makes a short, tidy data URI.
The same Base64 text, wrapped for where it is going.
| Format | Looks like | Use it in |
|---|---|---|
| Data URI | data:image/png;base64,iVBOR... | img src, CSS url(), JavaScript |
| Raw Base64 | iVBORw0KGgoAAAANSUhEUg... | APIs, JSON fields, databases |
| CSS | .img-logo { background-image: url(...) } | Stylesheets, icon sprites |
| HTML | <img src="data:..." width height alt> | Web pages, email signatures |
| JSON | { "name", "type", "dataUri" } | Config files, app assets |
| Markdown |  | README files, notes |
Base64 writes every 3 bytes as 4 text characters.
So a 9 KB PNG becomes about 12 KB of text. Gzip on your server wins back part of that, but inline images still cannot be cached on their own - change one CSS line and the browser downloads every inlined image again.
Rule of thumb: inline icons and images under about 5-10 KB, link everything bigger. To get under that line, shrink the PNG with Compress PNG or PNG to 8-Bit first.
<link rel="icon" href="data:..."> works in modern browsers. Make one with PNG to Favicon.Drop your PNG into the box. The Base64 appears right away as a data URI - press Copy and paste it into your HTML, CSS or code.
Need another shape? Pick raw Base64, CSS, HTML <img>, JSON or Markdown.
Raw Base64 is just the encoded text. A data URI adds a header like data:image/png;base64, so browsers know what it is - use it in src="" or CSS url(). APIs and JSON fields usually want the raw text.
Base64 turns every 3 bytes into 4 characters, so the text is about 33% larger than the file. The exact overhead for your image is shown under the code.
Turn on Make it smaller first to re-save as WebP or JPG, or shrink the PNG with Compress PNG before encoding.
For small images - icons, logos, tiny backgrounds and email signatures - where saving an extra request matters. Big photos are better as normal files, because Base64 cannot be cached separately and makes the page heavier.
Some email apps show them, but Gmail and Outlook often block data URIs. For newsletters, a hosted image or a CID attachment is safer. Base64 works well in HTML signatures and internal tools.
Open the Base64 to image tab, paste the text or the whole data URI, and press Decode. The tool reads the bytes, finds the real type (PNG, JPG, GIF, WebP, AVIF, BMP, ICO or SVG) and lets you download the file.
Yes. Any PNG, JPG, GIF, WebP, AVIF, BMP, ICO or SVG file can be encoded, and the MIME type in the data URI is taken from the file itself. For icons, see also ICO to Base64.
No. Encoding and decoding happen in your browser, so your images and text never leave your device.