No Signup Required

Image to Base64 Converter

Turn an image into Base64 and copy it as a Data URI, CSS, HTML, JavaScript, JSON or XML snippet.

  • Runs in your browser — nothing uploaded
  • Instant, no waiting in a queue
  • Free, no watermark, no daily limits

Upload, drop or paste an image (JPG, PNG, GIF, WebP, SVG, ICO, BMP or AVIF), or load it from a URL, and the tool encodes it to Base64 instantly. Choose one of 11 output formats — plain Base64, a Data URI, a CSS background-image rule, an HTML img, favicon, link or iframe tag, a JavaScript snippet, JSON or XML — and copy or download the result. The image type is detected automatically, and the file is encoded in your browser, so it is never uploaded.

Related: Base64 Encoder / Decoder

How to Convert an Image to Base64

  1. 1

    Add an image

    Choose a local file, drag and drop it, paste it with Ctrl+V, or enter an image URL.

  2. 2

    Pick the output format

    Select plain Base64, Data URI, CSS, HTML (img, favicon, link, iframe), JavaScript, JSON or XML.

  3. 3

    Copy or download

    Click Copy to put the result on your clipboard, or Download to save it as a file.

Why use ToolzBank Image to Base64?

  • 11 ready-to-paste output formats
  • Data URI with the image type detected automatically
  • JPG, PNG, GIF, WebP, SVG, ICO, BMP and AVIF
  • Upload, drag and drop, paste (Ctrl+V) or image URL
  • Shows dimensions, file size and Base64 size
  • Encoded in your browser — images never uploaded

Frequently asked questions

How do I convert an image to Base64?
Upload or paste the image above, choose an output format such as Data URI, and click Copy. The Base64 is generated instantly in your browser.
What is a Base64 Data URI?
A Data URI embeds a file directly in text, in the form data:image/png;base64,... so an image can be placed in HTML or CSS without a separate file.
Why is the Base64 bigger than my image?
Base64 represents every 3 bytes as 4 text characters, so the result is about 33% larger than the original file. That is why inline images are best for small icons and logos.
Is my image uploaded to a server?
No. The image is read and encoded in your browser and never leaves your device.
Why can’t an image URL be loaded?
Many websites block other sites from reading their images. If a URL fails, download the image and upload the file instead.

More free image tools