Image to Base64 converter
Get a Base64 data URL for any image, ready to paste into your code.
or drop it here, or paste it
Nothing is uploaded.
About Image to Base64
A Base64 data URL puts an image directly inside HTML, CSS, JSON or an email template as text, so it doesn't need a separate file. It works best for small images such as icons.
The text is made from your file exactly as it is, without changing the image. It is created in your browser, so your image never leaves your device.
The result is a data URL: text that starts with data:image/png;base64, or similar, followed by the encoded image. Paste it into the src of an img tag, a CSS background-image, or a JSON field. Use the copy button to put it on your clipboard in one tap.
Base64 text is about a third bigger than the image itself, and the browser can't cache it separately, so keep it for small images such as icons, logos in email templates and placeholders. For large photos, a normal image file loads faster. JPG, PNG, WebP, GIF, SVG and AVIF all work.
Questions and answers
Paste it where a link to the image would go, for example <img src="..."> in HTML or url(...) in CSS.
Base64 turns every 3 bytes into 4 text characters, so the text is about a third bigger than the file.
JPG, PNG, WebP, GIF, AVIF and SVG.