Image to Base64 Converter
Convert an image to a base64 data URI, or decode base64 back into an image, in either direction. Runs entirely in your browser; nothing you upload or paste is ever sent anywhere.
Drop an image here, or click to choose one
Quick Learn
Base64 turns arbitrary binary data — like an image's raw bytes — into plain text made up of only letters, digits, and a couple of symbols. That's useful anywhere binary data needs to travel through a text-only channel: embedded directly in CSS (background-image: url(data:image/png;base64,...)), inlined in HTML, or stored in a JSON field, all without a separate file request.
The cost is size: base64 text is about a third larger than the binary it represents, because it spends 8 bits of text to represent 6 bits of the original data. That trade-off usually makes sense for small icons and inline assets, and rarely makes sense for full-size photos, where the extra size and losing browser caching (the data is baked into the page itself, not fetched separately) outweigh the convenience. Everything here runs locally in your browser — nothing you upload or paste is sent anywhere.
Best Practices
- •Reserve base64-embedded images for small, single-use assets (icons, tiny UI graphics) — a browser can't cache an inline data URI separately from the page that contains it, unlike a normal image file.
- •A full data URI (data:image/png;base64,...) is what CSS and HTML expect directly; the raw base64 (no prefix) is what most APIs and JSON payloads expect — this tool gives you both so you don't have to strip or add the prefix by hand.
- •If a pasted base64 string fails to render, check that it wasn't truncated — a common cause is copying from a source that cuts off long text, silently producing an incomplete (and undecodable) string.
- •When pasting raw base64 without a data: prefix, make sure the MIME type you select actually matches the original image format — a PNG's bytes decoded as a JPEG (or vice versa) simply won't render.
More Image & Media Tools
QR Code Generator
Generate a QR code from text, a URL, or anything else, with adjustable size and error correction.
Barcode Generator
Generate Code128, EAN-13, and other common barcodes.
Image Compressor
Shrink image file size without leaving your browser.
Image Format Converter
Convert between PNG, JPEG, and WebP.
Favicon Generator
Generate a full favicon set from one image.
SVG Editor
Edit, recolor, resize, optimize, and export SVG markup, with a live preview.
Frequently Asked Questions
Want the engineering deep-dives behind tools like this one?