Image Conversion

Image to Base64

Encode images as Base64 data URIs in your browser. Copy the string for CSS, HTML, JSON APIs, or inline assets — processed locally, never uploaded.

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.

Turn any supported image into a Base64 data URI string. Paste into stylesheets, markup, or API payloads, then copy to the clipboard — all encoding happens on your device.

New to binary-to-text encoding? Read What Is Base65 Encoding and When Should You Use It? for a full explainer on Base64 alphabets, URL-safe variants, data URLs, and when encoding helps or hurts performance.

How to convert an image to Base64

Base64 encoding represents binary image data as ASCII text. Developers embed small icons in CSS, inline images in HTML email, or attach previews in JSON without hosting a separate file. This tool reads your image locally and outputs 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–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)

Base64 strings are roughly 33% larger than the raw binary file. For big images, a normal URL plus HTTP caching is almost always faster for end users.

Using the encoded string

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

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

In JavaScript / APIs: send the string as a field value; some endpoints want only the Base64 payload without the data: prefix — strip the header if your API docs require raw Base64.

Privacy note

Encoding runs entirely in your browser. Sensitive diagrams, screenshots, or unreleased creative assets never pass through ShoutingNow servers. Clear the page or close the tab when finished if you are on a shared computer — the textarea holds the full encoded content in memory.

Common questions

Quick answers before you start calculating.

Base64 turns binary image bytes into text so they can live inside URLs, JSON, or markup. A data URI combines the MIME type and encoded data in one string browsers understand.