Image tool

Image to Base64

Turn a JPG, PNG, WebP or AVIF image into a Base64 data URL you can paste into HTML, CSS or JSON. Free, and the image is encoded in your browser.

Your file never leaves your device.

Simple steps

How it works

  1. 01

    Choose a JPG, PNG, WebP, or AVIF image.

  2. 02

    Encode its original bytes as a data URL locally.

  3. 03

    Copy the result from the result panel.

How big the result is

Base64 writes every 3 bytes of the file as 4 characters, so the text is about 33% larger than the image. A 30,000-byte PNG becomes 40,000 characters, or 40,022 with the data:image/png;base64, prefix.

That is why inlining suits small images such as icons, logos and simple illustrations: the browser saves one request, but large images make your HTML or CSS heavier, cannot be cached on their own and slow the page down.

Output formats and what they contain

Besides the data URL, the result can be copied ready to paste: Base64 text without the prefix, a CSS background-image rule, an HTML img tag with the alt text, width and height filled in, a favicon link, a download link, a JSON or XML record with the file name, type and dimensions, or a Markdown image.

The image is not re-encoded: the Base64 text holds the file's original bytes, including any metadata such as camera details or GPS location. Remove that metadata first if the code will be published.

Good to know

Frequently asked questions

What is included in the result?

The result includes the image MIME type and Base64 data, ready to use as a data URL.

Does Base64 reduce image size?

No. Base64 text is typically larger than the original binary file.

Can I encode multiple images?

Choose one image per conversion so the result stays easy to copy and use.

Is the image uploaded?

No. The file is read locally and is never sent to a server.

What is the file size limit?

Images can be up to 25 MB; the resulting text can be substantially larger than the original file.