Image ⇆ Base64 Converter
Drag file here, or click to select file
Help
FAQ
What is a Data URI?ShowHide
A Data URI embeds file content directly in text, usually like data:image/png;base64,....
Why is Base64 larger than the original image?ShowHide
Base64 adds overhead (often ~33%). It’s convenient for embedding, but not always best for performance.
Do I need to paste the full data:image/... prefix?ShowHide
You can paste either a full Data URI or raw Base64. If you paste raw Base64, the tool will treat it as PNG by default.
Why does Base64 → Image show an error?ShowHide
The text may be incomplete, contain whitespace/invalid characters, or not represent an image.
How to convert image and Base64
- Choose Image → Base64 to generate a Data URI.
- Or choose Base64 → Image and paste a Data URI / Base64 string.
- Preview the image and copy/download the result.
Privacy
Full guide
What this tool does
This page supports two workflows:
- Image → Base64: upload an image and generate a Base64 Data URI.
- Base64 → Image: paste Base64/Data URI text and preview/download the decoded image.
When Base64 is useful
Base64 can be convenient for:
- Quickly embedding a tiny image in HTML/CSS for testing
- Sending an image through a text-only channel (debug logs, JSON payloads)
- Creating a Data URI for a small icon
For larger images, normal file URLs are usually better.
Examples
Example 1: Data URI prefix
A typical image Data URI looks like:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Example 2: Raw Base64 (no prefix)
You may also have raw Base64 like:
iVBORw0KGgoAAAANSUhEUgAA...
If you paste raw Base64, this tool assumes it’s a PNG image.
Tips
- If you plan to publish on the web, consider converting/compressing the image instead of embedding large Base64 strings.
- If you need text Base64 (non-image), use the separate text Base64 tool.