Image to Base64 Converter
Drop an image to encode it as Base64 and copy it as a data URI, raw Base64, HTML tag, CSS background, or Markdown.
Your files never leave your device — everything runs in your browser.
How to Use
- 1Drop a PNG, JPG, SVG, GIF, WebP, or ICO image.
- 2Check the original size and the encoded size.
- 3Pick the format you need: data URI, raw Base64, HTML, CSS, or Markdown.
- 4Click 'Copy' next to it and paste it into your code.
Frequently Asked Questions
When should I embed images as Base64?
It's useful for small icons and logos in HTML emails, single-file HTML pages, and CSS, where it saves an extra network request. For large photos it's usually worse, because Base64 is about a third larger and can't be cached separately.
What's the difference between a data URI and raw Base64?
A data URI adds a prefix such as data:image/png;base64, that tells browsers the file type, so it works directly in src and url(). Raw Base64 is just the encoded data, which APIs and JSON fields often expect.
Is my image uploaded?
No. Encoding happens in your browser with the FileReader API.