Image to Base64
Drop any image and get a Base64 string ready for CSS, HTML, JSON, or API payloads — instantly, in your browser.
Drop a file here or click to browse
Any file type — converted to Base64 locally
Any image format
PNG, JPG, GIF, WebP, SVG, BMP, ICO, HEIC — all supported.
Instant encode
Base64 output as soon as the file is read. Copy with one click.
Private by design
Files are read locally — nothing is uploaded or stored.
Why encode images as Base64?
Base64-encoded images can be inlined directly into HTML <img> tags, CSS background-image rules, JSON payloads, or email templates — no separate file request required. This is ideal for small icons, email signatures, and self-contained HTML reports.
Going the other way? Use the Base64 to Image tool.
Frequently asked questions
›How do I convert an image to Base64?
Drop a PNG, JPG, GIF, WebP, or SVG into the tool above (Encode mode). The image is read locally and the Base64 string is produced instantly — copy it into CSS, JSON, HTML, or an API payload.
›What image formats are supported?
Every file format is supported — PNG, JPEG, GIF, WebP, SVG, BMP, ICO, TIFF, and HEIC. Encoding is byte-level, so the format is irrelevant; the original bytes are preserved exactly.
›How do I create a data: URL?
Take the Base64 output and prefix it with data:<mime>;base64, — for example data:image/png;base64,iVBORw0KGgo… You can paste this directly into HTML img src, CSS background-image, or a JSON field.
›Is my image uploaded?
No. The file is read with the browser's FileReader and encoded locally. Nothing is uploaded, logged, or stored — safe for private screenshots and proprietary assets.
›Why is the Base64 longer than the original file?
Base64 represents every 3 bytes with 4 ASCII characters, so the encoded string is roughly 33% larger than the source image. That's the expected overhead for embedding binary data in text.
More free developer tools
Part of our growing tool belt — all client-side, all free.