🔒 Runs in your browser — nothing is uploaded✓ Free, no signup

Image to Base64 Converter

Drop, choose or paste an image to get its Base64 data URI — ready to use in CSS, HTML, JSON or Markdown. Your image never leaves your device.

The image is read on your device. It is never uploaded.

Base64 output

Choose an image to see its Base64 code.

When should you use the Image to Base64?

  • Embedding a small icon or logo directly in CSS
  • Adding images to HTML emails without hosting them
  • Putting an image into JSON or an API request body

How to use the Image to Base64

  1. 1

    Add an image

    Drag it onto the box, click to choose a file, or paste with Ctrl/⌘ V.

  2. 2

    Check the size

    See the original size and the Base64 size. Images over 100 KB get a warning.

  3. 3

    Pick a format

    Choose the data URI, plain Base64, a CSS rule, an <img> tag or Markdown.

  4. 4

    Copy

    Click Copy next to the format you need.

Examples

A small PNG icon

Input

icon.png (1.2 KB, 32 × 32)

Output

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…

background-image: url("data:image/png;base64,…");

Common errors and how to fix them

The Base64 string is enormous
Base64 adds about 33% to the file size. Compress or resize the image first with the Image Compressor, or serve large images as normal files.
Pasting doesn't work
Some browsers only paste images copied as images (not as files from a folder). Use drag and drop or the file picker instead.
Related tools: Base64 Encoder & Decoder · Image Compressor · Crop Image Online

More from Image Tools

Free tools that run in your browser — no signup, nothing uploaded.

Image to Base64 FAQ

Drop an image on the box, click to choose a file, or paste an image with Ctrl/⌘ V. The Base64 data URI appears instantly, ready to copy as plain Base64, CSS, an HTML <img> tag or Markdown.

A data URI embeds a file directly in your code, like data:image/png;base64,iVBORw0…. Browsers display it like a normal image URL, without a separate download.

For small images such as icons, tiny logos or placeholders — usually under a few kilobytes — in CSS, HTML emails or JSON. They save an extra request but can't be cached separately.

Base64 represents every 3 bytes as 4 text characters, so the result is about 33% larger than the original image. That's why large images are better served as normal files.

Any image your browser can read, including PNG, JPG, GIF, WebP, SVG, AVIF and ICO.

No. The image is read with your browser's FileReader and converted on your device. Nothing is sent to a server.