Viแป‡t Nam Papers
โ† Back to Tools

Image to Base64

Pick an image and get its Base64 string, ready to copy as a Data URI, raw Base64, HTML or CSS โ€” processed right in your browser.

How to use

  1. 1Choose or drag and drop an image file.
  2. 2Pick the output: Data URI, Base64 only, HTML <img> tag or CSS background.
  3. 3Click "Copy" to copy it to the clipboard, or click the result box to select the whole string.

Supported formats and limits

  • Accepts any image file. The preview only appears for formats your browser can display; an HEIC photo, for example, has no preview but is still encoded normally.
  • The Base64 string is an exact encoding of the original file: the image is not recompressed, resized or converted.
  • The Base64 string is about 33% larger than the file, because every 3 bytes become 4 characters.
  • The Data URI uses the file type your browser reports, for example data:image/png;base64,โ€ฆ

Privacy

The file is read and encoded in your browser. It is not uploaded to a server.

Frequently asked questions

What is the difference between a Data URI and Base64?

Base64 is just the encoded data. A Data URI adds a "data:image/โ€ฆ;base64," prefix that tells the browser what kind of image it is, so it can go straight into an <img> src attribute or a CSS url().

When should I embed images as Base64?

It suits small images such as icons, logos or pictures in HTML emails, saving a separate file request. For large images the long string makes your HTML or CSS heavier, so a normal image file is usually better.

Why is the result longer than the original file?

Base64 uses 4 characters for every 3 bytes of data, so the text is always about a third larger than the file.

How do I turn Base64 back into an image?

Use the Base64 to Image tool: paste the string, check the preview and download the file.

Everything runs right in your browser โ€” files are never uploaded to any server.