Convert an image file into a Base64 data URL.
Turn an image file into a Base64 data URL, or raw Base64 text, that you can paste into HTML, CSS, JSON or an email template. Choose a file, preview it, and copy the result. It accepts PNG, JPG, GIF, WebP, SVG, BMP and ICO files up to 10 MB, which covers icons, logos and small illustrations.
A data URL embeds file contents directly in a string using the form data:[mime type];base64,[data]. For an image this looks like data:image/png;base64 followed by the Base64 text of the file bytes. Browsers can use it anywhere a normal URL fits, such as an img src attribute or a CSS background-image, without a separate network request. That helps with tiny icons, email templates and self-contained HTML files. The cost is size: Base64 adds about a third to the file, and inlined images cannot be cached separately, so large images are better served as files.
No. The file is read locally and converted to text on the page; this tool does not send it anywhere.
A data URL starts with data:image/type;base64, followed by the encoded bytes. Raw Base64 is only the encoded bytes. Use the full URL in HTML or CSS and raw Base64 for APIs that ask for it.
Files up to 10 MB are accepted. Large images make very long strings, so inline only small ones.
The picker accepts PNG, JPG, JPEG, GIF, WebP, SVG, BMP and ICO files.
Paste it into the Base64 to Image tool, which previews the image and lets you download it.