Image to Base64

Turn an image into Base64 text, a data URI, an HTML tag or a CSS background, right in your browser.

Or drop or paste images here

Runs in your browser. Nothing is uploaded.

Or try a sample:

Convert an Image to Base64 Text

Image to Base64 is a free online tool that turns an image into Base64 text: a data URI to paste into HTML, CSS or JSON, plain Base64, a ready <img> tag or a CSS background. It writes the file's exact bytes, with the type its bytes show, and it works the other way too, from Base64 back to an image. It runs in your browser, so your images are never uploaded.

  • Free, no watermark
  • No sign-up
  • Nothing is uploaded
  • Works on phone and computer

How to Convert an Image to Base64

  1. 1 Upload Your Image

    Upload, drop or paste an image, or several at once.

  2. 2 Choose What to Copy

    A data URI, Base64 alone, an HTML <img> tag or a CSS background.

  3. 3 Copy or Download

    Copy the text and paste it where you need it, or download it as a text file.

Four Ways to Copy It

Data URI

data:image/png;base64, then the text: use it wherever a link to an image goes, in HTML, CSS or JSON.

Base64 alone

Just the Base64 text, for an API or a field that wants it on its own. Turn on lines of 76 characters for email and other formats that need them.

HTML <img> tag

The data URI in an <img> tag with the image's width and height, ready to paste into a page or an email template.

CSS background

A background-image line for a stylesheet, for icons and small patterns.

Image to Base64 at a Glance

ReadsPNG, JPEG, GIF, WebP, SVG, ICO, BMP, AVIF, HEIC, TIFF, JPEG XL
GivesA data URI, Base64 alone, an HTML <img> tag or a CSS background
SizeAbout a third larger than the file
Several imagesYes, all at once
PriceFree, with no sign-up
Where it runsIn your browser; nothing is uploaded

Updated December 2, 2026

Frequently Asked Questions

How do I convert an image to Base64?

Upload the image, choose Data URI, Base64, HTML or CSS, and press Copy. You can also download the text as a file.

What is a data URI?

A link with the whole file inside it: data:, the file's type, ;base64, and then the file as Base64 text. A browser shows it like an image from a web address, with no separate download.

Why is the Base64 text bigger than the image?

Base64 writes every 3 bytes of the file as 4 letters, digits or signs, so the text is about a third larger than the file.

When should I use a Base64 image?

For small images such as icons, logos and simple shapes, where saving the browser a separate download is worth the extra size, and where only text is allowed, as in JSON. A large photo is better as its own file, which loads faster and can be kept by the browser for next time.

Which image types can I convert?

Any image file, such as PNG, JPEG, GIF, WebP, SVG, ICO, BMP, AVIF, HEIC, TIFF and JPEG XL. The type in the data URI comes from the file's bytes, not its name, so a PNG named photo.jpg is still written as image/png.

Does it change my image?

No. The Base64 text holds the file's exact bytes: turn it back into an image and you get the same file, with the same quality and size.

Can I convert several images at once?

Yes. Upload or drop them together; each one is listed, and picking one shows its text.

How do I turn Base64 back into an image?

Press Base64 to Image at the top of the tool, or open the Base64 to Image page, and paste the text.

Are my images uploaded?

No. The conversion happens in your browser, both ways, and your images and text never leave your device.

Is it free?

Yes. It is free, with no sign-up and no limit on how many images you convert.

Convert Your Image