Skip to content
Encode & Decode

Base64 Image Encoder

Converts an image into a Base64 data URI that can be embedded directly in HTML or CSS, removing the need for a separate file request. The image is read and encoded in your browser — it is never uploaded anywhere.

Free, no signupRuns entirely in your browser
Input
Result
data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgcng9IjE1IiBmaWxsPSIjZWY0NDQ0IiAvPgogIDxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjMwIiBmaWxsPSJ3aGl0ZSIgLz4KICA8dGV4dCB4PSI1MCIgeT0iNTUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNiIgZm9udC13ZWlnaHQ9ImJvbGQiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IiNlZjQ0NDQiPlZJQkU8L3RleHQ+Cjwvc3ZnPg==
About

What the Base64 Image Encoder does

Use this sparingly and only for small assets. Base64 inflates the data by about a third, and an embedded image cannot be cached independently of the file containing it, so a large embedded image is downloaded again with every page load. Icons and tiny placeholders are good candidates; photographs are not.

How it works

Using the Base64 Image Encoder

  1. 1Select an image file from your device.
  2. 2The file is read locally as binary data.
  3. 3The bytes are encoded as Base64.
  4. 4A data URI is assembled with the correct MIME type prefix.
  5. 5Copy the result into your HTML src or CSS url().
Use cases

What people use it for

  • Embedding a small icon in CSS to save a request
  • Inlining a logo in an HTML email
  • Creating a self-contained HTML file with no external assets
  • Adding a tiny blurred placeholder for progressive image loading
FAQ

Frequently asked questions

6 related

Related tools

All tools →