Image to Base64 Converter
Encode an image as a Base64 data URI.
Data URIs embed images directly in code — handy for small icons and single-file demos.
How to use
- Choose an image file from your device.
- It is encoded to a Base64 data URI instantly.
- Copy the URI for use in HTML/CSS.
About this tool
Base64 inflates size by ~33%, so this suits small images, not photos.
Your image is read locally and never uploaded anywhere.
How it works
A data URI embeds a file directly as text: data:[mime-type];base64,[payload]. For a PNG that looks like data:image/png;base64,iVBORw0KGgo... — the browser decodes the Base64 back to bytes and renders it exactly like an image loaded from a URL.
Base64 inflates size by about 33%, and the string cannot be cached separately from the page, so data URIs suit small assets: icons, tiny logos, one-off thumbnails. A 2 MB photo as a data URI bloats the HTML and blocks rendering — link large images as files instead.
Because this converter runs entirely in your browser, the image never leaves your device — unlike server-side converters that upload your file first.
Worked examples
Inlining an icon in CSS: Convert a 2 KB arrow icon and paste background: url(data:image/png;base64,iVBOR...) into your stylesheet — one fewer HTTP request, and no broken image path to debug later.
Images in email drafts: Email clients often block external images but tolerate data URIs. Embed the logo directly so the draft looks right in the inbox preview.
Quick reference
| Part | Example |
|---|---|
| Scheme | data: |
| MIME type | image/png (or image/jpeg, image/webp) |
| Encoding marker | ;base64, |
| Payload | iVBORw0KGgo… (the encoded bytes) |
Frequently asked questions
When should I use data URIs?
Tiny icons and graphics where an extra HTTP request costs more than the size overhead.
Why is the output bigger?
Base64 encoding adds about one third to the file size.
Is my image uploaded?
No — processed 100% on your device.
More free tools
UUID Generator
Generate random v4 UUIDs in bulk.
Base64 Encode / Decode
Encode text to Base64 or decode it back.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
JSON Formatter & Validator
Format, minify and validate JSON in one click.
What Is My IP
See your public IP address instantly. No sign-up, nothing stored.
URL Encoder / Decoder
Encode or decode URLs and query strings.