Image to Base64

Convert an image to a Base64 / Data URI ready to paste into HTML img tags or CSS backgrounds. One-click copy, 100% local processing.

Click to select or drag an image here PNG, JPG, WebP, GIF and more · single file up to 30MB

How to use

  1. Drag an image onto the dashed area or click it to pick a local file. PNG, JPG, WebP, GIF and other common formats are supported.
  2. The image is converted automatically into a Data URI such as data:image/png;base64,…….
  3. Under "Output content", choose the full Data URI or the Base64 body without the data: prefix.
  4. Click the "Copy" button in the corner of the result box, or download the string as a .txt file.

FAQ

Where can I use a Data URI?
The most common uses are the src attribute of an HTML img tag or background-image: url(...) in CSS — handy for small icons and signatures that should not trigger an extra network request.
Why is the converted string so long?
Base64 represents binary data as text and takes roughly 1.37× the file size, so large images produce very long strings. For pages, embedding is only recommended for images up to a few tens of KB.
What does "Base64 only" mean?
A full Data URI looks like data:image/png;base64,AAAA... — the data:image/png;base64, part is the prefix. The "Base64 only" mode strips this prefix and keeps just the encoded content after the comma.
Is my image uploaded anywhere?
No. Everything happens locally in your browser — neither the image nor the generated string ever leaves your device.

Related Tools