Generate / Image to Base64

Image to Base64

Upload any image and convert it to a Base64 data URI string for embedding.

Image Input
Base64 Output

Base64 output appears here

Quick Reference

Drag & Drop

Drop any image file directly onto the input area.

Output Formats

Copy as full Data URI or raw Base64 string without prefix.

About Image to Base64

Upload any image and convert it to a Base64 data URI string for embedding in HTML, CSS, or JSON. RAW's Image to Base64 Converter handles PNG, JPEG, GIF, WebP, SVG, and more. Get the data URI, raw Base64, or CSS background-image snippet instantly.

How to use

  1. 1Drag and drop an image or click to upload.
  2. 2The Base64 data URI is generated instantly.
  3. 3Choose between full data URI, raw Base64, or CSS snippet.
  4. 4Copy the encoded string to embed in your code.

Frequently Asked Questions

Why would I embed images as Base64?
Base64 embedding eliminates extra HTTP requests, which can improve load times for small images like icons, logos, and sprites. It's also useful for embedding images in JSON APIs, emails, and single-file HTML documents.
Is there a size limit?
There's no hard limit, but Base64 encoding increases file size by ~33%. Images larger than 10KB are generally better served as separate files. Base64 is best for small icons and thumbnails.
Which output formats are available?
RAW provides three output formats: full data URI (for HTML img src), raw Base64 string (for API payloads), and CSS background-image snippet (for stylesheets).