Skip to content
IMG

Image to Base64

Encode images to Base64/data URLs, and decode them back.

Runs in your browser — data never leaves your device

Drop an image, click to browse, or paste with Ctrl/Cmd+V

PNG / JPG / GIF / WEBP / BMP / ICO / SVG · 10MB max

Base64 inflates binary data by about 33% because it re-encodes bytes as text. Everything runs locally in your browser — images are never uploaded.

About Image to Base64

Encoding an image as Base64 turns binary data (PNG, JPEG, etc.) into an ASCII string — a data URI — that you can embed directly inside HTML or CSS instead of linking to a separate file. This tool works in both directions: encode an image to Base64, or decode a Base64/data URL string back into a viewable, downloadable image. Beyond file picking and drag-and-drop, you can paste directly from the clipboard (Ctrl/Cmd+V) — handy for pasting a screenshot straight in. Encoding produces five ready-to-use outputs at once: raw Base64, a full data URL, an <img> tag, a CSS background-image declaration, and Markdown image syntax. You also get the file name, MIME type, pixel dimensions, original byte size, encoded size, and the inflation rate, so you can judge on the spot whether embedding is a good idea. Decoding accepts either a full data URL or a bare Base64 payload, sniffing the image format from its magic bytes when no MIME type is given. Because Base64 packs 3 bytes into 4 characters, the encoded string is roughly 33% larger than the original file. That trade-off pays off for small icons or sprites — fewer network round trips — but embedding anything much larger than a few dozen KB bloats the HTML/CSS document itself, slows first paint, and defeats normal image caching. As a rule of thumb, keep inlining to small icons and logos; for photos and larger assets, a regular image URL is usually the better choice. Every file you upload or Base64 string you paste stays in your browser — nothing is ever uploaded to a server.

How to use

  1. Drop, select, or paste (Ctrl/Cmd+V) an image
  2. Copy Base64, Data URL, HTML, CSS, or Markdown
  3. To go back, paste Base64/a data URL and download the image

FAQ

What is image to Base64?

It encodes an image file as an ASCII string you can embed directly in HTML or CSS, typically as a data URL like data:image/png;base64,....

Which formats are supported?

PNG, JPEG, GIF, WebP, BMP, ICO, and SVG. When decoding, the format is auto-detected from the file's magic bytes.

Can I paste an image straight from the clipboard?

Yes. Copy a screenshot (or any image) and press Ctrl/Cmd+V anywhere on the tool page to load it instantly.

Does Base64 make the image bigger?

Yes, about 33% larger than the original file. That's fine for small icons, but embedding large images slows first paint — a regular image URL is usually better for anything sizable.

Is my image or Base64 data sent anywhere?

No. Both encoding and decoding run entirely in your browser — nothing is ever sent to toco.tools's servers.