Base64 Image Encoder
Upload an image and instantly get its Base64-encoded data URI for embedding in HTML or CSS.
Upload Image
Output Format
Upload an image to see the Base64 output
Original size:
—
Encoded size:
—
Overhead:
—
MIME type:
—
Encoded Output
Summary
Upload an image and instantly get its Base64-encoded data URI for embedding in HTML or CSS.
How it works
- Click "Choose Image" or drag and drop an image file onto the upload area.
- The tool reads the file using the browser FileReader API and encodes it to Base64.
- A live preview of the image appears alongside the generated data URI string.
- Select the output format you need: full data URI, Base64-only string, or an HTML/CSS snippet.
- Click "Copy" to copy the output to your clipboard, ready to paste into your code.
Use cases
- Embed small icons or logos in HTML emails where external images may be blocked.
- Include images inline in a single-file HTML document or web app.
- Set CSS background images via a data URI to avoid an extra HTTP request.
- Store small images as strings inside JSON configuration or data files.
- Test image rendering in environments that block external URLs.
- Bundle assets into a self-contained HTML prototype for sharing.
Frequently Asked Questions
Related tools
Last updated: 2026-05-23 ·
Reviewed by Nham Vu