Image to Base64 Converter

Choose a picture to get its Base64 text, data URL, CSS background rule and HTML image tag. Or paste Base64 text or a data URL below to see the picture and download it.

Free Runs in your browser Checked Tuesday, November 10, 2026

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Click Choose a file and pick the picture, or drop it on the box. The Base64 text appears below it.
  2. Copy the Data URL, Base64 text, CSS background rule or HTML image tag with the Copy button beside it.
  3. To go the other way, paste Base64 text or a data URL into the box under Base64 text or data URL and click Show the picture.
  4. Click Download the picture to save it with the type and extension it has.

What Base64 is

Base64 writes any bytes with 64 safe letters and digits (RFC 4648). Every three bytes become four characters, so the text is about a third bigger than the file. It does not compress or hide anything: anyone can decode it.

What a data URL is

A data URL (RFC 2397) puts a file inside the address itself: data:, then the picture type, then ;base64, and the Base64 text. A browser shows it in an image tag or a CSS background without asking the server for a file. It suits small pictures and icons; a large picture makes the page heavy.

Your picture stays on your device

The file is read and turned into text in your browser, and a pasted string is read there too. Nothing is uploaded. The type of a pasted picture is worked out from its first bytes, so a wrong label does not fool the tool.

Example: a small icon

A 3000-byte PNG icon becomes about 4000 characters of Base64 text, a third bigger than the file. The data URL adds the 22 characters data:image/png;base64, in front of it.

Frequently asked questions

Is my picture uploaded when I convert it?

No. The file is read and turned into Base64 text in your browser, on your own device. You can check by turning off your internet connection after the page has loaded and converting a picture.

Why is the Base64 text bigger than my file?

Base64 writes every three bytes of the file with four characters, so the text is about 33 % bigger. It is only another way of writing the same bytes.

When should I use a data URL?

Data URLs suit small pictures such as icons, placeholders and small logos, because they need no separate request to the server. For large photographs, host the file and link to it, since Base64 makes the page heavier and cannot be cached on its own.

Can I paste a data URL from a web page?

Yes. Paste the whole data URL, starting with data:, or only the Base64 part after the comma. The picture type is found from the bytes, so a wrong label in the header does not matter.

Why does the tool not show a very long text?

A text box can slow down with millions of characters, so Base64 text longer than 2 million characters is not shown. Use its download button to save it as a text file.

Is Base64 a way to hide or protect a picture?

No. Base64 is an encoding, not encryption. Anyone who has the text can decode it back into the same picture in one step, so do not rely on it to keep a picture private.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.