Image to Base64 Converter

Convert images to a Base64 (data URI) string and copy ready-to-use <img> tag and CSS background snippets with one click. Or paste a Base64 string to restore and download the image. Everything runs in your browser - your images are never uploaded.

Last updated: 2026/10/18 Developer Feedback & bug reports

Drag & drop

or

Ctrl+V to paste a screenshot directly

JPEG, PNG, GIF, WebP, SVG, ICO (max 10MB) / iPhone photos (HEIC) are converted to JPG first

How to Use

1

Choose a direction

Use "Image → Base64" to encode an image into a data URI, or "Base64 → Image" to restore a data URI back into an image.

2

Provide an image or Base64

Drag & drop, select a file, or paste with Ctrl+V. For decoding, paste the Base64 string into the text box.

3

Copy or save the result

Copy the data URI, <img> tag, or CSS snippet in one click. Restored images can be downloaded directly.

About the Image to Base64 Converter

An online tool that encodes image files into a Base64 "data URI" string. A data URI lets you embed an image directly into HTML or CSS, reducing HTTP requests and speeding up loading of icons and small images. You can also paste a Base64 string or data URI to restore and download the original image. All processing happens entirely in your browser (JavaScript), so your images are never sent to any server.

Features

  • Two-way conversionEncode images to Base64 and decode Base64 back to images - both in one tool.
  • Copy-paste readyCopy the data URI, <img> tag, and CSS background snippet with a single click.
  • Ctrl+V paste supportPaste screenshots or copied images with Ctrl+V (Cmd+V) and convert instantly.
  • Browser-only processingEverything runs locally in your browser. Your images are never uploaded to a server.

Use Cases

  • Embed small icons and logos directly in CSS/HTML
  • Inline images in HTML emails or web fonts
  • Inspect Base64 images inside API JSON responses
  • Save a data URI image as a file
  • Speed up pages by reducing HTTP requests

FAQ

Are my images uploaded to a server?
No. All conversion happens locally in your browser (JavaScript). Your image data is never sent to or stored on any server.
What is a Data URI (data URL)?
It is a format that represents image data as a string, like "data:image/png;base64,...". It can be embedded directly into HTML or CSS so the image displays without loading an external file.
Does Base64 change the file size?
Base64 encoding increases the data size by about 33%. It is therefore best suited to small images like icons rather than large photos.
Which image formats are supported?
Any browser-supported format including JPEG, PNG, GIF, WebP, SVG, and ICO. iPhone photos (HEIC) can't be shown on web pages as they are, so they are converted to JPG first. You can convert files up to 10MB.
Do I need a MIME type to decode Base64 back to an image?
A string with the "data:image/...;base64," prefix works as-is. For a raw Base64 string without a prefix, the tool detects the format from the data signature and tries to restore it.
Does it work on smartphones?
Yes. It works in any browser on smartphones, tablets, and PCs.