Image to Base64 Converter
Turn an image into a Base64 data URI you can paste straight into HTML, CSS, JSON or an email template, so the image travels inside the code instead of as a separate file.
Free · No sign-up · Files stay on your device
How to use Image to Base64
- 1Choose an image.
- 2Pick the output: data URI, raw Base64, HTML or CSS.
- 3Copy the code.
Features
- Data URI, raw Base64, HTML and CSS outputs
- PNG, JPG, GIF, WebP, SVG and ICO
- Shows original and encoded size
- Preview of the image
- Converted locally in your browser
When to embed images as Base64
Base64 is handy for small icons and logos in emails, single-file HTML pages, CSS sprites and API payloads, because it saves an extra download. Base64 makes files about 33% larger, so keep using normal image files for photos and large images.
Frequently asked questions
Why is the Base64 bigger than the image?
Base64 uses 4 characters for every 3 bytes, so the text is about 33% larger than the original file.
Is there a size limit?
Up to 10 MB, though Base64 is best for images under about 10 KB.
Can I convert Base64 back to an image?
Yes. Use the Base64 to Image tool.
Related tools
Base64 to ImageConvert Base64 strings and data URIs back to images. Preview the image, detect its format automatically, and download it as PNG, JPG, GIF, WebP or SVG.Base64 EncodeEncode text or files to Base64 online for free. Full UTF-8 support, URL-safe option and data URI output. Runs in your browser.Compress ImageCompress JPG, PNG and WebP images online for free. Reduce image file size by up to 90% without visible quality loss. Batch compress in your browser, no upload.