Encode any image to a Base64 / Data URI string β ready to paste into CSS, HTML, JSON or email. Or switch to decode mode and convert a base64 string back to an image. No upload required β everything runs in your browser.
Drop your image here or click to browse
JPG, PNG, WebP, SVG and more Β· Max 10 MB Β· No upload
Drop or select an image
Drag and drop any JPG, PNG, WebP, SVG or other image file onto the upload area (max 10 MB). No upload β the file stays on your device.
Choose output format
Select from four formats: full Data URI, plain base64 string, CSS background-image rule, or an HTML <img> tag. The textarea updates instantly.
Copy and use
Click Copy to send the string to your clipboard. Paste it directly into your CSS file, HTML template, API payload or email client.
Use the Base64 to Image tab to verify a base64 string you received from an API or email before embedding it. Try SVG to PNG
Copy as a full Data URI (data:image/β¦), a plain base64 string (no prefix), a CSS background-image rule, or a ready-to-paste HTML <img> tag. One click to switch format.
All encoding and decoding runs in your browser using native FileReader and the Clipboard API. Your images never touch a server.
Switch to Base64 to Image mode and paste any base64 string or Data URI to preview the image instantly and download it as a file.
Base64 encoding turns binary image data into a plain text string that can travel safely inside JSON payloads, HTML attributes, CSS files or email templates. Common uses include inlining small icons to eliminate a network request, embedding images in HTML emails where external URLs are blocked, or passing images through APIs that only accept text.
A Data URI wraps the base64 string with a MIME type prefix such as data:image/png;base64, so browsers and apps know how to interpret the bytes. You can paste a Data URI directly into an <img src> attribute or a CSS background-image property without any additional file hosting.
Base64 maps every 3 bytes of binary data to 4 ASCII characters (6 bits per character). That means 3 bytes become 4 characters, increasing the data volume by roughly one third. For small icons (under a few kilobytes) the overhead is negligible. For large photos, consider using a normal compressed image served from a CDN instead.
Paste any valid base64 string or full Data URI into the decode tab and click Preview. The tool normalizes the input β if you provide a plain base64 string without a prefix it assumes image/png β then renders the image directly in the browser. If the string is invalid, a clear error is shown. Once previewed, click Download to save the image as a file.
Any format your browser can read: JPG, PNG, WebP, GIF, AVIF, BMP, and SVG. The base64 output preserves the original format's MIME type in the Data URI prefix, so downstream decoders know exactly what type of image to expect.
After encoding, you may want to compress your image first to reduce the base64 string size, convert an SVG to PNG before encoding, or use the Favicon Generator to create multi-size .ico files for your site.