Convert image to Base64 (data URI)
Select or drop an image
Generates the Base64 (data URI). Everything happens in your browser.
Select an image to generate the Base64 code (data URI). Copy it as plain text or as a CSS background-image. Nothing is sent to servers.
What it is for
The image to Base64 converter turns an image into a text string (data URI). Instead of a separate file, you get a code you can paste directly into HTML or CSS.
It is widely used by developers to embed icons and small images inside the code, avoiding an extra request to the server for each file.
Output formats
- Plain text: the full data URI, ready to use in the src attribute of an img tag.
- CSS background-image: the code already in url(...) format to apply as a background.
- Quick copy: copy the result with one click and paste it wherever you need.
When to use
- Embed a small icon in HTML or CSS without an external file.
- Include an image in an email or template that does not allow attachments.
- Avoid one extra network request for tiny images.
Limitations
Base64 increases the size by about 33% compared to the original file, so it is meant for small images, like icons, and not for large photos. Conversion happens in your browser, with nothing sent to servers.
Frequently asked questions
- Can I use Base64 for any image?
- Technically yes, but it is not recommended for large photos. Base64 grows by about 33% over the original, so it is best for small images such as icons and logos.
- Can it generate code ready for CSS?
- Yes. Besides plain text, the tool offers output in background-image format, with url(...), ready to paste into your stylesheet.
- Is my image sent to any server?
- No. The Base64 conversion happens in your browser, so the image never leaves your device.