Image to Base64

Turn a local image into raw Base64 or a full data URI for CSS, HTML, or JSON. Files are read in the browser only.

Drag and drop file here, or click to browse

Result

Choose an image to encode. Files are read locally.

How to convert an image to Base64

  1. Choose or drop a PNG, JPEG, GIF, WebP, BMP, or SVG file (within size limits).
  2. Encoding starts automatically after the file is read locally.
  3. Toggle data URI mode if you need a data:image/...;base64, string.
  4. Copy or download the output. The file is not uploaded.

FAQ

A data URI embeds the image inline, for example data:image/png;base64,... You can paste it into an img src or CSS background without hosting the file.
PNG, JPEG, GIF, WebP, BMP, and SVG (SVG max 1MB, and scripted SVG is blocked). Other images are limited to 10MB.
No. The file is read locally with FileReader. Preview object URLs are revoked when you reset or leave the page.
Most raster images are limited to 10 MB. SVG uploads are capped at 1 MB and scanned for script content before encoding.
Raw Base64 is typical for APIs and JSON fields. Toggle data URI mode when you need a single string for an img src or CSS url() without hosting the file.

Related tools