Runs in your browser

Convert an Image to a Base64 Data URI

A data URI inlines the image into the document, so there is no extra request and no broken icon when a file has to be self-contained. The trade is size: base64 is about a third larger than the binary and cannot be cached on its own.

Nothing is uploaded. Processing happens on your device with no server round-trip.

Privacy: Common image formats use Canvas; some formats use single-thread FFmpeg WASM in your browser. Larger files may take longer.

Settings

Only the options this page needs are exposed. Everything else is fixed to match the page intent.

Output contract

Accepted input
JPEG, PNG, WEBP, GIF, BMP
Output format
TXT
Processing engine
Canvas + browser encoders
Batch limit
10 × 10.00 MB
Upload
None — files stay on this device

If the target cannot be reached the result shows the real output size instead of a false success.

No results yet

Recent Tasks

No history recorded yet

How to use this page

  1. 1Drop the image. Nothing is uploaded; the file is read by the browser and encoded locally.
  2. 2Leave the format on "auto" to keep the source type, or pick JPEG/PNG/WebP if the URI has to match an existing asset.
  3. 3Download the .txt: it contains the data URI with paste-ready HTML, CSS and Markdown snippets, plus the real size cost.

What is different here

  • The download is a text file with the URI plus four snippets — HTML img, CSS background, CSS custom property and Markdown — so nothing has to be reassembled by hand.
  • "Auto" keeps the source format, which matters for a transparent PNG: forcing JPEG here would flatten the alpha channel before anything was asked for.

Limits worth knowing

  • Base64 inflates the payload by roughly 33% and must be parsed before the image can paint, so it suits icons and small logos rather than photos.
  • A GIF is exported as its first frame: a canvas cannot carry animation into a data URI.

Frequently asked questions

Is a data URI faster?▾
Only by removing one request. It is downloaded with the document every time and cannot be cached separately, so a normal file wins for anything reused across pages.
Why is the URI so long?▾
Every three bytes become four characters. A 100KB icon becomes roughly 136,000 characters, which is why editors slow down when one is pasted into CSS.
Can I get the bare base64 without the prefix?▾
The text file carries the full data URI and the snippets. Strip everything up to and including the comma to keep only the encoded payload.