Toolezs
Back to All Tools
Image to Base64

Free image to Base64 converter and Base64 to image decoder.

Encode an image to a Base64 string or data URI, or paste Base64 and turn it back into a picture. Everything runs in your browser — nothing is uploaded.

Your images and Base64 strings stay here in this tab. Encoding and decoding happen in your browser — nothing is uploaded, and nothing is kept once you close it.

Add images

Up to 10 images, 5 MB each. Reads PNG, JPG, WebP, GIF, BMP, AVIF, SVG and ICO, and encodes the exact bytes — no re-encoding, no resizing.

Everything happens here in your browser — nothing is uploaded.

Why this is handy

Base64 turns an image into plain text, so the picture can travel wherever a file cannot: inside JSON, a stylesheet, an HTML template or a Markdown note. There is no second file to lose — the text carries the image with it. It works both ways: encode an image to a Base64 string or data URI, or paste Base64 and turn it back into a picture.

How to convert an image to Base64 online

  1. 1.Add your image: drag it onto the page or click to browse. Up to 10 images at a time, 5 MB each.
  2. 2.Pick the output you need — a Data URI, Base64 only, an HTML img tag, a CSS background or Markdown.
  3. 3.Each image gets its own card with the Base64 string. Copy it, or download it as a .txt file.
  4. 4.Working with several images? Use Copy all or Download all.

The encoding uses the browser’s own file reader, so the string is the exact content of your file — nothing is re-compressed or renamed.

How to convert Base64 to an image

  1. 1.Open the Base64 to Image tab above, or open this page through its #base64-to-image link to land on the decoder.
  2. 2.Paste your Base64 string or the whole data:image/…;base64, URI. Line breaks are fine, and URL-safe Base64 works too.
  3. 3.The tool checks the string, reads the image type from the bytes themselves, and shows a preview with the size and dimensions. Type a file name and download the image.

Why use this converter?

  • Private by design: the encoding and decoding happen in your browser, so the image never leaves your device. Nothing is uploaded, and nothing is kept once you close the tab.
  • Exact bytes: the Base64 is copied straight from the file, so decoding gives the original picture back — no re-encoding, no compression, no resizing.
  • Five output shapes: a data URI, raw Base64, an HTML img tag, a CSS background or Markdown — whichever shape your code expects.
  • Works both ways: paste Base64 back in to see the picture, with the type read from the file itself rather than trusted from its prefix.

Tips before you convert

Base64 text is about a third larger than the file it encodes, so shrink a photo before you encode it. Compress Image cuts the file size, and Image Converter switches it to a lighter format such as WebP. Base64 suits small icons and logos, so if a logo needs a clean background, tidy it up with Background Remover first. And when the picture belongs in a document, put it in a PDF with Image to PDF instead of pasting a long string.

Two habits save trouble later: keep encoded images small, and keep the original file. A huge Base64 string is slow to paste and awkward to edit, while the original is easy to re-encode.

Common uses

Small icons and logos in HTML or CSS, image data inside JSON, email signatures, single-file HTML demos, Markdown notes and config files — anywhere only text can travel. Decoding is just as useful: paste a Base64 string and see the picture without installing a decoder.

Frequently asked questions

Is this image to Base64 converter free?

Yes. There is no sign-up, no watermark and no limit on how often you use it, on a computer, tablet or phone.

Are my images uploaded when I convert them?

No. The encoding and decoding happen in your browser, so your images and Base64 strings never leave your device. Nothing is kept after you close the tab.

What is the difference between Base64 and a data URI?

Base64 is only the encoded text. A data URI adds a short prefix that names the file type — data:image/png;base64, — and that is the version a browser or an HTML attribute can display directly.

Can I turn Base64 back into an image?

Yes. Switch to the Base64 to Image tab, paste the string or the whole data URI, and download the picture. The file type is read from the bytes, so the right extension is used.

Does converting an image to Base64 reduce its quality?

No. The tool copies the file's own bytes, so the decoded image is identical to the original. The Base64 text is about 33% larger than the file, which only matters for big pictures.

Is there a file size limit?

You can encode up to 10 images at a time, 5 MB each. The decoder accepts strings up to 14,000,000 characters.

Which image formats can I convert?

PNG, JPG, JPEG, WebP, GIF, BMP, AVIF, SVG and ICO. Decoding recognises the same types from their contents, so a mislabelled file still opens correctly.

Will a Base64 image work in an email or on a web page?

It works in HTML, where the data URI sits in the src attribute, and in CSS. Some email clients block data URIs, so test before you send.

Want the full walkthrough, with JavaScript and Python examples? Read How to convert an image to Base64.