Skip to content
OneFileConverter

Convert an image to Base64

Get a ready-to-paste data URI for embedding small images straight into code.

Formats
JPG, PNG, WebP +14
Up to
100 MB per file
Price
Free, no sign-up
Watermark
No watermarks

Drop files here

or choose from your device

Processed on your device · nothing is uploaded

JPG, PNG, WebP, AVIF, HEIC, GIF, BMP, TIFF, PSD, RAW, SVG, TGA, PPM, PCX, DDS, ICO, JPEG XL · up to 100 MB per file

How to convert an image to Base64

  1. Add your images — up to 20.
  2. Nothing to set: the data URI includes the right image type.
  3. Click Convert — copy the text or download a .txt file per image.

What the output contains

Each image becomes one line of text: data:, the image type such as image/png, then ;base64, and the encoded file. The type comes from the file's actual contents, not its extension. The page shows the start of the first result, up to 2,000 characters; download the .txt files for the complete text, one per image. Up to 20 images of 100 MB each are accepted.

Metadata travels with it

Because the bytes aren't changed, everything in the original file is encoded too, including EXIF details such as camera model and GPS location in photos, and anyone who decodes the string can read them. Run photos through Remove EXIF data first. To shorten the text, shrink the image with Compress image or Resize image before encoding, since a data URI is about a third larger than the file.

Check the format is supported

The data URI keeps the original format, so a WebP or AVIF stays WebP or AVIF and an animated GIF still animates. Make sure the place you paste it supports that format: current browsers show JPG, PNG, GIF, WebP and AVIF, but a TIFF data URI won't display in most browsers or email apps. Convert a TIFF to PNG or JPG with Image converter first.

Are my images safe?

Yes. Your images are only used to create your result — they’re never shared and never used to train AI.

How do I use the result?

Paste it wherever an image URL goes: <img src="data:image/png;base64,…"> in HTML or background-image: url("data:…") in CSS.

Should I Base64 large images?

Base64 is about a third bigger than the file and can't be cached separately, so it suits small icons and logos. Compress the image first for best results.

Is the image changed or compressed?

No. The file's bytes are encoded exactly as they are, so quality, metadata and GIF animation are all kept. The one exception is iPhone HEIC photos, which are converted to JPG on your device first because most browsers can't display HEIC.