🔀

Image ↔ Base64 Converter

Convert images to Base64 encoded strings, or paste a Base64 string to preview and download the image. 100% private — no server upload.

📂

Click to upload or drag & drop an image

PNG, JPG, GIF, WebP, SVG supported

About Image ↔ Base64 Converter

Encode any image to a Base64 string for embedding in HTML, CSS, or JSON. Or decode a Base64 string back to a viewable and downloadable image. Supports all major image formats. Copy the result as a raw Base64 string, a full data URL, or a ready-to-use HTML <img> tag.

How to Use — Image to Base64

  1. Select the Image → Base64 tab.
  2. Upload any image file (PNG, JPG, GIF, WebP, SVG).
  3. The Base64 encoded string appears instantly below the preview.
  4. Click Copy Base64 to copy the raw string, Copy Data URL for the full data:image/... URI, or Copy <img> tag for a ready-to-paste HTML snippet.

How to Use — Base64 to Image

  1. Select the Base64 → Image tab.
  2. Paste your Base64 string (with or without the data:image/...;base64, prefix).
  3. Click Decode Image to preview the image.
  4. Click Download Image to save it to your device.

Frequently Asked Questions

Base64 is a method of encoding binary data (like image files) into a text string using only ASCII characters. This lets you embed image data directly into HTML, CSS, or JSON without needing a separate image file or URL.
Base64 is useful for small icons or logos embedded directly in CSS or HTML to eliminate an extra HTTP request. It is also used in emails (where external images may be blocked) and in JSON APIs that transfer image data as text.
Base64 encoding increases the data size by approximately 33% because every 3 bytes of binary data are represented as 4 characters of text. For large images this overhead can be significant, which is why Base64 is best suited for small images.
A Data URL (or data URI) combines the MIME type and the Base64 string into a single string in the format data:image/png;base64,.... You can use it anywhere a normal image URL is accepted, such as in an HTML src attribute or CSS background-image.
No. The entire conversion happens in your browser using the FileReader API. Your image data never leaves your device.