Image to Base64

Convert an image to a Base64-encoded string for embedding in HTML, CSS, or JSON. Free and private. Your image is read locally and never uploaded.

Converts an image file into a base64-encoded data URL you can paste straight into HTML, CSS, or JSON, handy for embedding icons, inlining small images to cut HTTP requests, or pasting a logo into an email template or API payload.

How to use it

  1. Upload or drag in your image
  2. Copy the generated base64 string or full data URL
  3. Paste it into your HTML, CSS, or code

Frequently asked questions

What's the difference between base64 output and a data URL?
Base64 alone is just the raw encoded text. A data URL wraps it with a prefix like data:image/png;base64, so it tells the browser the file's MIME type and can be dropped directly into an <img src>, CSS background, or JSON payload.
Why did my base64 string get so much bigger than the original file?
Base64 encoding turns every 3 bytes of binary data into 4 text characters, so expect roughly a 33% size increase over the original image file.
Can I use the output directly in HTML or CSS?
Yes. Copy the full data URL and paste it as the src attribute of an <img> tag or inside a CSS url() for a background-image, no separate image file or hosting needed.