Image to Base64 Converter
Embed small images directly in HTML, CSS, JSON or email templates. Drop an image to get its Base64 data URI in ready-to-paste formats, or paste Base64 to turn it back into an image.
How to convert an image to Base64
- Drop an image or choose one from your device.
- Pick the output format: a data URI, raw Base64, an HTML tag, CSS or Markdown.
- Copy it into your code. To decode, paste Base64 or a data URI into the box and click Decode.
When to use Base64 images
A data URI embeds the image bytes as text, so no separate file request is needed. That is useful for tiny icons, single-file HTML documents, email templates and JSON payloads.
Base64 makes data about 33% larger than the original file and cannot be cached separately by the browser, so it is a poor choice for large photos. As a rule of thumb, embed images under a few kilobytes and serve larger ones as normal files.
SVG images can often be embedded more efficiently as URL-encoded text instead of Base64. Compress images first with our image compressor to keep the output small.
Need a different tool? Suggest it here — we read every message.
Frequently asked questions
What is a Base64 data URI?
Text that starts with data:image/png;base64, followed by the encoded image bytes, usable anywhere a URL is expected.
Does Base64 make images bigger?
Yes, by about a third.
Can I convert Base64 back to an image?
Yes. Paste it into the box and click Decode.
Is my image uploaded?
No. Encoding and decoding happen in your browser.