Image to Base64

Convert any image to a Base64 data URI instantly — copy the full URI, bare Base64 or an HTML snippet, all in your browser.

100% in your browser No watermark No sign-up

How it works

  1. Drop any image (JPG, PNG, WebP, GIF, SVG…) onto the zone — it never leaves your device.
  2. The FileReader API converts the raw bytes into a Base64-encoded data URI instantly.
  3. Copy the full Data URI, the bare Base64 string, or a ready-made <img> HTML tag.

Frequently asked questions

Is the image uploaded to a server?
No. Encoding runs entirely in your browser via the FileReader API. Your image bytes never leave your device.
What is the difference between the Data URI and Base64 only outputs?
A data URI includes the MIME-type prefix (e.g. data:image/png;base64,) followed by the Base64 string. The "Base64 only" output strips that prefix and gives you just the raw encoded bytes — useful when an API or CSS property already expects the bare string.
Why is the encoded output larger than the original file?
Base64 represents every 3 bytes of binary data as 4 ASCII characters, so encoded output is roughly 33% larger than the source file.
Can I embed the data URI directly in HTML or CSS?
Yes. Use the "Use in HTML" snippet to drop an inline <img> tag anywhere on a page without an external file reference. For CSS, paste the data URI as the value of a background-image property.
Which image formats are supported?
Any format your browser can read: JPEG, PNG, WebP, GIF, BMP, SVG, AVIF, ICO and HEIC (on supported browsers). The MIME type is detected automatically.

More Image tools