DevTilt

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.

What is Image to Base64?

Inline images in HTML emails, CSS backgrounds, and JSON API payloads often require Base64 data URIs instead of file URLs. Upload an image here to get the encoded string with the correct MIME prefix — no terminal, no Node script, no upload to a third-party server.

Why use DevTilt's Image to Base64?

  • File upload for PNG, JPG, WebP, and GIF
  • Outputs data URI with correct MIME type prefix
  • Shows original file size and encoded length
  • Copy raw Base64 or full data URI

Common use cases

  • Embedding a small logo in an HTML email template
  • Creating a data URI for a CSS background-image rule
  • Sending an image inline in a JSON API request body
  • Testing how a backend handles Base64 image uploads

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.