Convert images to Base64 and vice versa. Supports PNG, JPEG, GIF, WebP, BMP, SVG, and ICO.
Output as Data URI, HTML <img>, CSS background-image, Markdown, JSON, or XML.
All processing happens locally in your browser — your images are never uploaded to any server.
Direction:
Format:
Upload Image
📷
Click to choose or drag & drop an image here
PNG, JPEG, GIF, WebP, BMP, SVG, ICO — Max 10 MB
⚠ Large image (>5 MB). The encoded Base64 will be very long. Consider compressing first.
Format:
-
Dimensions:
-
File Size:
-
Base64 Size:
-
Output (Base64)
Encoding: Image → Base64 Upload or drag & drop an image to encode it to Base64. Choose from 7 output formats: Data URI (embed directly in web pages), Raw Base64, HTML <img>, CSS background-image, Markdown, JSON, or XML.
Decoding: Switch direction to decode a Base64 string back to an image — paste any Base64 or Data URI and see the image preview. The image format is auto-detected from magic bytes (PNG, JPEG, GIF, WebP, BMP, ICO, SVG).
URL-safe: Replaces + with - and / with _, and strips trailing = padding.
Formats supported: PNG, JPEG, GIF, WebP, BMP, SVG, ICO.
Privacy: All processing is done locally in your browser — your images are never uploaded.
When inlining images is worth it
Inlining an image as a data URI saves one HTTP request, but the Base64 text is roughly 33% larger than the raw bytes and cannot be cached separately from the page. That trade is worth it for small icons and single-use graphics, and usually wrong for photos and repeated assets.
Rule of thumb: inline images under a few KB — for anything bigger, a separately cached image file wins on repeat visits.
🔷 Image Base64 Info
Output Formats 7 formats for different use cases.
Data URI data:image/png;base64,...
Raw Base64 Plain base64 string only
HTML <img src="..."> tag
CSS background-image: url(...)
Markdown / JSON / XML Embed in docs, APIs, configs