Free Image to Base64 Converter

Convert any image to a Base64 data URI for embedding in HTML or CSS.

Embedding small images as Base64 data URIs saves an extra HTTP request, which can help performance for tiny icons — but for anything beyond a few KB, a regular image file with proper caching headers is almost always better, since Base64 encoding adds roughly 33% to the file size and can't be cached separately from the HTML/CSS it's embedded in.

Worked Example

Example output: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... — paste this directly as an <img src=""> value or CSS background-image: url(...).

Method

Uses FileReader.readAsDataURL() to read the uploaded file directly as a Base64 data URI string.

Worked Example

Example output: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... — paste this directly as an <img src=""> value or CSS background-image: url(...).

Method

Uses FileReader.readAsDataURL() to read the uploaded file directly as a Base64 data URI string.