Base64 Image Converter

Convert images to Base64 data URIs and decode Base64 strings back to images. Upload, drag-and-drop, or paste a data URI — get code snippets for HTML and CSS instantly. All in your browser, no upload.

Upload an image or paste a Base64 string to see the preview.
File: — Type: — Size: — Dimensions: —

About the Base64 Image Converter

This Base64 image converter runs entirely in your browser. Upload an image file to generate a Base64 data URI, or paste a data URI to decode it back into an image. The tool provides ready-to-use CSS and HTML code snippets for embedding images inline. Nothing is uploaded — all processing happens locally with JavaScript.

How to use

  1. Image to Base64: Click the file input and select an image. The Base64 data URI appears in the output box with a live preview.
  2. Base64 to image: Paste a data URI into the text area and click Decode to image to see the preview and file info.
  3. Use the copy buttons to get the Base64 string, CSS background-image rule, or HTML <img> tag.
  4. Click Download image to save the decoded image to your device.

What is a Base64 data URI?

A data URI is a scheme that allows embedding binary data (like images) directly into text files as a Base64-encoded string. This eliminates the need for a separate HTTP request, which can improve performance for small images. Data URIs are commonly used in CSS backgrounds, HTML img tags, JSON payloads, and email templates.

Frequently asked questions

What image formats are supported? PNG, JPEG, GIF, SVG, WebP, and any other format supported by your browser.

Is there a file size limit? The only limit is your browser's available memory. Very large images will produce very long Base64 strings, which may slow down some text editors.

Are my images uploaded anywhere? No. Everything happens locally in your browser. No images leave your device.