Skip to main content

Image to Base64 Converter

Drop an image and get a Base64 data URL, raw base64, or <img>/CSS snippet.

Drop an image here, or click to choose

About this tool

Image to Base64 Converter — drag an image into the page and get its Base64 representation in any of four formats.

Output formats

  • Data URL: data:image/png;base64,… — paste into CSS, JSON, or HTML.
  • Raw Base64: just the encoded bytes (no MIME prefix).
  • <img> tag: ready-to-drop markup.
  • CSS background: background-image: url("…"); snippet.

Resize and reformat

Pick a max width (320 / 640 / 1024 / 1920 px) and a target format (PNG / JPEG / WebP / GIF) to downscale or convert the image before encoding. Useful for keeping email-friendly < 50 KB inline images.

Privacy

Encoding happens entirely in your browser via the Canvas API — your image never leaves the device.