Toolonit
  1. Home
  2. Image
  3. Image to Base64

Image to Base64 Converter

Turn an image into a data: URI string.

Drop images here or click to choose

JPG, PNG, WebP, GIF, BMP, ICO, SVG or AVIF. Files are processed in your browser and never uploaded. They stay in this browser until you remove them.

Ctrl+OchooseCtrl+Vpaste

Turn an image into text you can put straight into HTML, CSS, JSON or Markdown. Drop one or more images to get each one's data URI, raw Base64, CSS background rule, HTML <img> tag and Markdown image, each a single click from your clipboard. The files are read by your browser and never leave your device; it's free and needs no sign-up.

How to convert an image to Base64

  1. Drop images anywhere on the page, paste one with Ctrl+V, or click to choose files. Images you added in any other image tool are already here, as they are now: one you resized or cropped there and applied gives the edited picture's data URI. The sample image lets you try it without a file.
  2. Click Data URI, Base64, CSS, HTML or Markdown under an image to copy that snippet. Ctrl+C copies the selected image's data URI.
  3. Paste it where you need it, or download it as a text file. With several images, Download all (ZIP) saves every one at once.

Features

  • Five snippets per image: data URI, raw Base64, CSS background-image, HTML <img> and Markdown
  • The HTML tag includes the width, the height and an alt text taken from the file name
  • One click to copy; Ctrl+C copies the selected image's data URI
  • Several images at once, with a .txt file per image or all of them in one ZIP
  • A warning for images over 100 KB, where linking the file is usually better
  • PNG, JPG, GIF, WebP, SVG, AVIF, BMP and ICO, with the right MIME type even when the browser doesn't give one

Is it private?

Yes. Your browser reads the file and converts it on the page; nothing is sent anywhere, and the images stay in this browser until you remove them. The data URI is the file itself, so it carries a photo's metadata along: when there's a GPS location or other metadata, the tool tells you and points to the EXIF Viewer to remove it first.

Frequently asked questions

When should I use a data URI?

For small images such as icons, logos and tiny backgrounds, where saving a separate request matters, and wherever a file can't go: an HTML email, a single-file page, a JSON field or a Markdown document. For large photos, link the file instead, so the browser can cache it.

How much bigger does Base64 make a file?

About a third bigger. Base64 uses 4 characters for every 3 bytes, so a 30 KB image becomes about 40 KB of text. Above about 100 KB, linking the file is usually better, and the tool warns you.

Which snippet should I copy?

Data URI for an src or url() you write yourself, CSS for a ready background-image rule, HTML for a complete <img> tag with width, height and alt text, Markdown for documentation, and Base64 when an API or a JSON field wants the bare encoded data.

Can I convert several images at once?

Yes. Add as many images as you like; each gets its own snippets, and Download all (ZIP) saves a text file per image.

Related tools