Skip to content
QZTools

Convert an image to Base64

Embed an image straight into your code with no separate file: ideal for icons, HTML emails and tests.

Your files are processed directly in your browser. They are never uploaded to a server.

How to convert an image to Base64

  1. 1

    Add or paste an image.

  2. 2

    Pick the format: data URI, Base64, CSS, HTML or Markdown.

  3. 3

    Copy the result or download it as .txt.

About this tool

Base64 represents the image bytes as text. A data URI adds the file type in front so browsers and editors understand it.

Use it for small images: Base64 is about 33% larger than the original file.

Conversion happens in your browser; the image is never uploaded.

Frequently asked questions

What's the difference between Base64 and a data URI?

A data URI is the Base64 with a prefix like data:image/png;base64, that states the image type.

Does it work with SVG?

Yes. Also with GIF, ICO, BMP and AVIF.

Related tools

More Images tools