Image to Base64 Converter

Convert an image to a Base64 data URI for HTML, CSS or JSON — or paste Base64 to preview and download the image.

InstantPrivate — runs in your browserFree, no sign-up

Your details

Convert
Your image
Output as
Line breaks and spaces are ignored. The image type is detected automatically.

Result

How to use

  1. 1

    Choose “Image → Base64” and drop an image (a small sample is shown until you do).

  2. 2

    Pick the output style — data URI, plain Base64, CSS or an HTML img tag — and press Copy.

  3. 3

    To go the other way, choose “Base64 → Image”, paste the text, and download the picture.

Questions

Why is the Base64 text bigger than the image?

Base64 stores every 3 bytes as 4 text characters, so it is about 33% larger than the original file. That is why it suits small icons and logos, not big photos.

When should I use a data URI?

For tiny images (a few KB) inside HTML, CSS, emails or JSON, where saving an extra file request helps. For larger images a normal image file loads faster and can be cached.

Is my photo uploaded anywhere?

No. The image is opened and processed on a canvas inside your browser. Nothing is sent to any server, so it works even offline once the page has loaded.

About this Image to Base64 tool

Image to Base64 Converter — Convert an image to a Base64 data URI for HTML, CSS or JSON — or paste Base64 to preview and download the image. It is one of 200 free tools on namasivayam.in, made by software engineer Namasivayam Vadivelan for everyday use in India.

Everything is calculated instantly in your browser: nothing you type or upload is sent to any server, there is no sign-up, and it works on mobile and desktop. Choose “Image → Base64” and drop an image (a small sample is shown until you do).

Related reading

Articles that go with this tool

All articles →

Related tools

More image tools you may like

All 200 tools →

Results are estimates to help you plan. They are not financial, tax or medical advice.