Image to Base64 Converter

RFC 2397 Data URIs: encode images to Base64 or decode Data URI, raw Base64, CSS, HTML, and JSON back to an image.

Upload an image to encode to Base64. Switch to Decode to paste a string instead.

Image Conversion

Encode an image as a Base64 data URI without leaving your browser, then copy the string straight into CSS, HTML, or a JSON payload, all processed locally and never uploaded anywhere.

Turn any supported image into a Base64 data URI string you can paste into a stylesheet, markup, or an API payload, then copy it to the clipboard, all encoded right on your own device.

New to binary-to-text encoding? Our guide, What Is Base65 Encoding and When Should You Use It?, walks through Base64 alphabets, URL-safe variants, data URLs, and when encoding helps or hurts performance.

How to convert an image to Base64

Base64 encoding just represents binary image data as plain ASCII text. It is why developers embed small icons in CSS, inline images inside HTML email, or attach previews in JSON without hosting a separate file for each one. This tool reads your image locally and hands you back a ready-to-paste data URI.

  1. Upload an image: select JPG, PNG, WebP, GIF, or BMP from your device.
  2. Generate Base64: click the primary action to encode the file.
  3. Review the output: the textarea shows the full data:image/…;base64,… string.
  4. Copy to clipboard: use the copy button to paste into your project or API client.

What is a data URI?

A data URI embeds file content directly in a URL string. For images it looks like:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…

The prefix declares the MIME type (image/png, image/jpeg, etc.). Everything after the comma is Base64-encoded binary data. Browsers decode it on the fly for <img src="…"> or background-image: url(…).

When Base64 helps, and when it does not

Good fit Poor fit
Tiny icons and sprites under ~2 to 4 KB Large hero photos or gallery images
Single-file HTML prototypes or demos Assets that should be cached separately by CDN
Email templates with embedded images Pages where Lighthouse performance scores matter
API JSON fields that require inline binary Images that change often (invalidates whole document cache)

Keep in mind Base64 strings run about 33% larger than the raw binary file, so for big images, a normal URL paired with HTTP caching will almost always be faster for whoever is loading the page.

Using the encoded string

In HTML: paste the full data URI right into an img element’s src attribute.

In CSS: wrap it in background-image: url("data:image/…") for small decorative graphics.

In JavaScript / APIs: send the string as a field value, though some endpoints only want the Base64 payload without the data: prefix, so strip that header first if your API docs call for raw Base64.

Privacy note

Encoding happens entirely in your browser, so sensitive diagrams, screenshots, or unreleased creative assets never pass through a ShoutingNow server. If you are on a shared computer, close the tab or clear the page once you are done, since the textarea keeps the full encoded content sitting in memory.

Common questions

Quick answers before you start calculating.

It turns binary image bytes into plain text so they can live inside a URL, a JSON payload, or markup. A data URI just combines the MIME type and that encoded data into one string browsers already know how to read.