Image to Base64 converter
Updated Nothing is uploaded
Encode a PNG, JPG, SVG, WebP, GIF or ICO as Base64 and copy it as a data URI, CSS background, HTML <img> tag, Markdown or JSON. You'll also see exactly how much bigger the Base64 text is.
How to convert an image to Base64
- Choose an image.
- Pick the output: Data URI, Base64 only, CSS, HTML, Markdown or JSON.
- Copy it to the clipboard or download it as a file.
How much bigger is Base64?
Base64 turns every 3 bytes into 4 text characters, so the size is 4 × ⌈bytes ÷ 3⌉ — about 33% larger, plus the data:image/png;base64, prefix for a data URI.
| Image file | Base64 length | Overhead |
|---|---|---|
| 1 KB (1,024 B) | 1,368 chars | +33.6% |
| 10 KB | 13,656 chars | +33.4% |
| 100 KB | 136,536 chars | +33.3% |
| 1 MB | 1,398,104 chars | +33.3% |
When to inline images
- Good: tiny icons and placeholders (under ~5–10 KB), HTML emails that block linked images, single-file demos, JSON APIs that need an image field.
- Bad: photos and large images — they bloat HTML/CSS, can't be cached separately and delay rendering.
- For SVG, a URL-encoded
data:image/svg+xml,…is often smaller than Base64.
Private by design
Everything runs in your browser — your images and videos are never uploaded, stored or seen by anyone.
Related tools
Frequently asked questions
What is a data URI?
A URL that contains the file itself: data:[type];base64,[data]. Browsers can use it anywhere a normal image URL works (RFC 2397).
Is my image uploaded?
No. It's read and encoded in your browser.
Why is my Base64 string so long?
Base64 is always about 4/3 of the file size. Compress or resize the image first to shorten it.
How do I decode it back?
Use the Base64 to image converter — paste the string or data URI and download the file.
Your business here? Sponsor this tool from $9/week. See placements