Turn an image into Base64 text, a data URI, an HTML tag or a CSS background, right in your browser.
A data URI suits small images such as icons and logos. A large image loads faster as its own file.
Runs in your browser. Nothing is uploaded.
Image to Base64 is a free online tool that turns an image into Base64 text: a data URI to paste into HTML, CSS or JSON, plain Base64, a ready <img> tag or a CSS background. It writes the file's exact bytes, with the type its bytes show, and it works the other way too, from Base64 back to an image. It runs in your browser, so your images are never uploaded.
Upload, drop or paste an image, or several at once.
A data URI, Base64 alone, an HTML <img> tag or a CSS background.
Copy the text and paste it where you need it, or download it as a text file.
data:image/png;base64, then the text: use it wherever a link to an image goes, in HTML, CSS or JSON.
Just the Base64 text, for an API or a field that wants it on its own. Turn on lines of 76 characters for email and other formats that need them.
The data URI in an <img> tag with the image's width and height, ready to paste into a page or an email template.
A background-image line for a stylesheet, for icons and small patterns.
| Reads | PNG, JPEG, GIF, WebP, SVG, ICO, BMP, AVIF, HEIC, TIFF, JPEG XL |
|---|---|
| Gives | A data URI, Base64 alone, an HTML <img> tag or a CSS background |
| Size | About a third larger than the file |
| Several images | Yes, all at once |
| Price | Free, with no sign-up |
| Where it runs | In your browser; nothing is uploaded |
Updated December 2, 2026
Upload the image, choose Data URI, Base64, HTML or CSS, and press Copy. You can also download the text as a file.
A link with the whole file inside it: data:, the file's type, ;base64, and then the file as Base64 text. A browser shows it like an image from a web address, with no separate download.
Base64 writes every 3 bytes of the file as 4 letters, digits or signs, so the text is about a third larger than the file.
For small images such as icons, logos and simple shapes, where saving the browser a separate download is worth the extra size, and where only text is allowed, as in JSON. A large photo is better as its own file, which loads faster and can be kept by the browser for next time.
Any image file, such as PNG, JPEG, GIF, WebP, SVG, ICO, BMP, AVIF, HEIC, TIFF and JPEG XL. The type in the data URI comes from the file's bytes, not its name, so a PNG named photo.jpg is still written as image/png.
No. The Base64 text holds the file's exact bytes: turn it back into an image and you get the same file, with the same quality and size.
Yes. Upload or drop them together; each one is listed, and picking one shows its text.
Press Base64 to Image at the top of the tool, or open the Base64 to Image page, and paste the text.
No. The conversion happens in your browser, both ways, and your images and text never leave your device.
Yes. It is free, with no sign-up and no limit on how many images you convert.