● converted entirely in your browser — image never uploaded
Image to Base64 encoder
Drop an image (PNG, JPG, WebP, or iPhone HEIC) to get its Base64 data URI, ready to paste into CSS (`background-image: url(...)`) or an `<img src>`.
Click or drop an image here
How it works
Dropped files are read with the browser's FileReader.readAsDataURL, which produces a Base64-encoded data URI directly — no manual encoding step. iPhone HEIC/HEIF files are first converted to JPEG entirely client-side using the heic2any library, since most browsers can't decode or preview HEIC natively.
FAQ
Why does the tool convert HEIC files to JPEG instead of encoding them directly?
Most browsers can't decode or display HEIC/HEIF images at all, so an iPhone photo is first converted to JPEG entirely client-side (via heic2any) — the data URI you get is a JPEG, not the original HEIC bytes.
Why is the resulting text so much longer than the original file size?
Base64 encodes every 3 bytes of binary image data as 4 text characters, so a data URI is roughly a third larger than the source file — that overhead is normal and unavoidable for this encoding.
Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.