Data URI · inline assets
Image Base64
Encode images to Base64 Data URIs for inline embedding, or decode Base64 strings back to downloadable image files.
Drop images here
Click or drag · up to 20 files, 1 MB each
JPG · PNG · GIF · WebP · SVG · more
Options
Encoding results
What Is Base64 and When Should You Use It?
Base64 is a binary-to-text encoding that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It expands data by ~33% but makes binary files embeddable in text contexts like HTML, CSS, JSON, and email.
Common use cases
- Inline images in HTML/CSS — small icons or backgrounds embedded directly in the markup, eliminating an HTTP request.
- Email attachments — MIME email standards use Base64 to encode binary attachments in text-based email formats.
- API payloads — sending binary data (images, PDFs) in JSON without file upload endpoints.
- SVG data URIs — embedding SVGs inline in CSS background-image properties.
When not to use Base64
Base64 is not encryption — anyone can decode it. For large images, avoid Base64: a 200 KB image becomes ~267 KB as Base64, and embedding it in HTML prevents browser caching of that resource.
Frequently Asked Questions
Base64 encodes 3 bytes of binary data into 4 ASCII characters, adding about 33% overhead. This is a fundamental property of Base64, not a bug. It's a trade-off for text compatibility.
A Data URI is a URI scheme that lets you embed file content directly in documents. Format: data:[mediatype];base64,[data]. For example: data:image/png;base64,iVBORw0.... You can use it as the src of an <img> tag or in CSS background-image.
No. Base64 is an encoding, not encryption. Any Base64 string can be decoded instantly by anyone. For sensitive images, use proper access-controlled URLs with authentication headers, not Base64 embedding.