Base64 Image Encoder / Decoder

Convert images to Base64 strings for embedding in HTML, CSS, or JSON, or decode Base64 back to images. Everything runs in your browser — no upload, no account, no tracking.

No image selected

Click or drag image here

Supports JPEG, PNG, WebP, BMP, GIF

Base64 Encoding

Processed entirely in your browser. No data sent to any server.

How to encode images to Base64

  1. Drop or select your image file above
  2. The Base64 string is generated automatically
  3. Copy the string or the full data URI
  4. Paste it into your HTML img src, CSS background, or code

When to use Base64 images

Use caseRecommendedNotes
HTML email inline imagesYesMany email clients block external images; Base64 works inline
CSS background (small icons)YesSaves HTTP requests for icons under 2 KB
Single-file HTML / PDFYesEmbeds images directly with no external dependencies
API / JSON payloadsSometimesUseful for small thumbnails; inefficient for full-size photos
Website performance (large images)No33% size increase blocks HTML parsing; use URL references instead

Frequently asked questions

When should I use Base64 for images?
Base64 is useful for small images (icons, logos) embedded in HTML emails, CSS, or single-file applications. It eliminates extra HTTP requests but increases file size by about 33%. Avoid it for large images.
What is a data URI?
A data URI combines the MIME type and the Base64 string into one string you can use directly: data:image/png;base64,iVBOR.... Paste it into an img tag's src attribute.
Does Base64 encoding reduce image quality?
No. Base64 is a lossless encoding — the decoded image is pixel-identical to the original. The trade-off is file size: the Base64 string is about 33% larger than the binary original.
What's the maximum image size I can encode?
Your device memory is the only limit. However, very large images produce huge Base64 strings (a 1 MB image becomes ~1.3 MB of text). For web use, keep Base64-encoded images under 10 KB for best performance.

More free image tools