Image to Base64 Converter

Drop an image, choose a format and copy the Base64 code.

Your text and files never leave your browser — nothing is sent to a server.

Drop an image here, click to choose one, or paste with Ctrl+V

How to use

  1. Drop an image onto the box, click it to pick a file, or paste a screenshot with Ctrl+V (⌘V on Mac).
  2. Check the preview, dimensions and how much the Base64 version grows compared with the original file.
  3. Choose an output format: a full data URL, the raw Base64 string, a CSS background-image rule, an HTML <img> tag with width and height, or Markdown.
  4. Click “Copy” to grab the code, or “Download” to save it as a text file.

FAQ

When is it worth embedding an image as Base64?

For small icons, logos or placeholders it saves an extra HTTP request and keeps everything in one file, which is handy for emails and single-page demos. For larger photos a normal image file is usually better because it can be cached separately.

Why is the Base64 version bigger than the file?

Base64 writes every 3 bytes as 4 characters, so the encoded text is about 33% larger than the original image.

Is my image uploaded anywhere?

No. The file is read and converted entirely inside your browser and never leaves your device.

Related tools

All tools