Image to Base64

Image to data URI and back: drop, paste, preview, copy as CSS or HTML.

Runs locally · nothing uploaded
Preview of the selected image
Drop an image here, click to choose one, or paste it with Ctrl+V.
PNG, JPEG, GIF, WebP, SVG, AVIF, ICO, BMP
Click, drop or paste another image to replace it
Output

What it does

Inlining small images as data: URIs saves an HTTP request for icons, email templates and single-file HTML. This tool does the conversion in both directions.

Image → Base64

  • Drop an image, click to choose one, or paste a screenshot straight from the clipboard with Ctrl+V.
  • See a preview with the type, pixel dimensions, original size and the Base64 size, so you know exactly how much the encoding adds (about a third).
  • Copy the result as a data URI, raw Base64, a CSS background-image rule, an HTML <img> tag with width and height filled in, or Markdown.
  • The type is detected from the file’s bytes, so a PNG saved as .jpg still gets the right MIME type.

Base64 → Image

  • Paste a data URI or raw Base64 (line breaks, missing padding and the URL-safe alphabet are fine).
  • The format is detected from its magic bytes (PNG, JPEG, GIF, WebP, AVIF, SVG, ICO, BMP, TIFF…), shown in a preview, and downloaded with the correct extension. A mismatch between the declared and the real type is flagged.

How to use it

Pick a direction, then drop or paste. Everything updates immediately; Copy (or Ctrl+Enter) puts the selected format on your clipboard.

Privacy

Images are read and encoded locally in your browser and never uploaded. The last image you encoded (if it is reasonably small) and the last Base64 you pasted are kept in your browser’s local storage; Clear removes them.