Codrenix Toolbox logoCodrenix Toolboxby Codrenix

Image to Base64

Convert an image to a Base64 data-URI string, copy to clipboard with one click — JPG, PNG and WebP, in your browser.

Quick answer

Turn a JPG, PNG or WebP image into a Base64 data-URI string with one-click copy — perfect for inlining in HTML, CSS or code. Everything runs in your browser, so nothing is ever uploaded.

Drag & drop an image here

or click to browse — JPG, PNG or WebP up to 20MB

Image files only — up to 20MB each

How to convert an image to Base64

  1. Upload an image

    Drop in a JPG, PNG or WebP image — up to 20MB.

  2. Get the string

    The Base64 string appears instantly. Click Copy to grab the full data-URI.

  3. Paste into your code

    Paste the string into an HTML src, CSS background-image, or any code that accepts data URIs.

Key features

Instant result

The Base64 string is generated the moment your image loads.

One-click copy

Copy the full data-URI to your clipboard with a single click.

Format preserved

Works with JPG, PNG and WebP and outputs the matching MIME type.

No uploads

All encoding happens in your browser — your image never leaves your device.

Supported formats

  • JPG / JPEG (.jpg, .jpeg)
  • PNG (.png)
  • WebP (.webp)

Privacy and security

Your image is processed entirely within your browser using the FileReader API. No file is uploaded to any server, and the Base64 string is generated locally on your device. Once you close or refresh the tab, the data is gone.

Limitations

  • Base64 encoding adds ~37% size overhead — best for small images. Large images produce very long strings.
  • Max file size 20MB.
  • Works on JPG, PNG and WebP only.
All tools