Free Base64 Converter - Convert Images to Data URI & Code

Convert images into inline Base64 data URLs for HTML/CSS embedding, or decode existing Base64 strings into downloadable files.

Drop image to convert to Base64 & Data URI

Generates Raw Base64 (for APIs), Data URI, HTML img tags, CSS background-image, and JSON payloads

⌘V / Ctrl+Vto paste from clipboard
No image handy? Try an instant sample:

Base64 String to Image Decoder

Paste raw Base64 or Data URI below — automatically detects PNG, JPEG, WEBP, GIF, or SVG

How to convert an image to Base64

  1. Drop in an image.
  2. Copy whichever output you need: data URI, HTML or CSS.
  3. To decode, paste a Base64 string or data URI into the decoder box and click Decode & Preview.

Embedding images in HTML and CSS

Turning a small image into Base64 lets you put it straight into your HTML or CSS, with no separate file to host. Handy for tiny icons, email templates, or a quick prototype.

Drop an image in and you get three versions to copy: the raw data URI, a ready-made <img> tag, and a CSS background-image line. It also works the other way. Paste a Base64 string and you can preview the image and download it.

Frequently asked questions

Should I Base64 all my images?

Please don't. Base64 makes a file about a third bigger, and the browser can't cache it separately. It's worth it for small things like icons. For photos, link to a normal file.

My decoded image won't show up

Check that the whole string got pasted. Long strings often get cut off when copied. It's fine to include the "data:image/png;base64," part at the start, or to leave it off.

Related tools