Image to Base64

Turn images into data URIs for CSS, HTML and JSON. Convert any image to a Base64 data URI instantly. Copy ready-to-use CSS, HTML and JSON snippets. No upload — runs entirely in your browser. Free Base64 image encoder.

This tool runs 100% in your browser. Your input is never sent to any server — you can even go offline after the page loads.

About the Image to Base64

A Base64 data URI embeds an image directly inside CSS, HTML or JSON, removing an extra network request — a classic trick for small icons, email templates and single-file demos. Drop an image here and this tool produces the full data URI plus ready-made snippets: a CSS background-image rule, an HTML img tag and a JSON-safe string. It also warns when the file is too large for embedding to be sensible.

How to use the Image to Base64

  1. Drop or select your image.
  2. The Base64 data URI is generated instantly.
  3. Copy the snippet for your target: CSS, HTML or JSON.
  4. Heed the size warning if the file is large.

Key features

When should I embed an image as Base64?
For small assets — icons, logos under ~10 KB — where eliminating a request beats the ~33% size overhead of Base64. Large photos belong in files.
Why does the Base64 string look longer than the file?
Base64 encodes 3 bytes into 4 characters, adding roughly 33% overhead. That is inherent to the format, not a bug.

Related Image & Design tools

More utilities from the same category.

View all →