Kotopig

Image to Base64 Encoder & Decoder

Turn images into Base64 data URIs — or decode them back — instantly and privately in your browser.

🔒 100% private ⚡ No upload 🆓 Free & unlimited

How it works — 4 steps

  1. 1

    Pick a direction

    Use the toggle to switch between encoding (image → Base64) and decoding (Base64 → image).

  2. 2

    Add your input

    Drop an image to encode, or paste a Base64 string / data URI to decode.

  3. 3

    Copy or preview

    Copy the Base64 as a data URI, CSS or HTML snippet, or preview the decoded image.

  4. 4

    Download

    When decoding, save the recovered image with one click — nothing was uploaded.

Why use Kotopig?

🔒

Your files stay private

Images are processed on your device and never uploaded to any server.

⚡

No upload queue

Choose your settings and process images directly on your device.

🆓

Free, no sign-up

No account, no watermarks on output, no per-day limits. Just open and use.

Using Base64 images in HTML, CSS and JSON

Base64 lets you embed an image directly inside code as text instead of linking to a separate file. That's handy in the right places and wasteful in the wrong ones. Here's how it works and when it makes sense.

Anatomy of a data URI

A data URI looks like data:image/png;base64,iVBORw0KGgo…. It has three parts: the data: scheme, the MIME type (image/png, image/jpeg, image/svg+xml…), and the Base64-encoded bytes after the comma. Browsers treat the whole string as if it were the address of an image file.

Where you'd use it

  • HTML: <img src="data:image/png;base64,…"> for a small icon that should appear instantly with the page.
  • CSS: background-image: url("data:image/svg+xml;base64,…") for tiny decorative graphics, avoiding an extra request.
  • JSON and APIs: many APIs accept or return images as Base64 strings because JSON can't carry raw binary data.
  • Single-file documents: self-contained HTML reports or prototypes where external files would get lost.

When not to use it

A practical rule: inline only small assets, roughly a few kilobytes or less. Shrink images with the Image Compressor or Resize Image before encoding to keep strings short.

  • Large photos: the encoded text is about a third bigger than the file, and it can't be cached separately — it re-downloads with every page or stylesheet that contains it.
  • Images reused across many pages: a normal image file is downloaded once and cached; an inlined copy is repeated everywhere.
  • HTML email: support is inconsistent — some major webmail clients don't display data-URI images. Test in your recipients' email apps before relying on it.

A tip for SVG

SVG is already text, so for CSS you can often URL-encode it instead of Base64-encoding it, which produces a shorter string. Base64 remains the simplest option that works everywhere, and it's what this tool produces. For a raster version of an SVG, use SVG to PNG.

Frequently asked questions

Are my images uploaded to a server?

No. Every operation runs entirely inside your browser using your device's own processor. Your files never leave your computer, so the tool works even with the page disconnected from the internet after loading.

What is a Base64 image (data URI)?

Base64 encoding represents binary image data as plain text. Wrapped as a data URI (data:image/png;base64,…), that text can be embedded directly in HTML, CSS or JSON, so the image loads without a separate file request.

When should I use a Base64 image?

It's ideal for small assets like icons and logos in HTML or CSS, where inlining the image saves an HTTP request. Email support is inconsistent, so test before using it in newsletters or signatures. Avoid it for large photos — the text is bigger than the file and can't be cached separately.

Does Base64 make the image larger?

Yes, Base64 output is roughly 33% larger than the original binary file. That's the trade-off for embedding it as text; the underlying image quality is unchanged.

How do I decode a Base64 string back into an image?

Switch to the “Base64 → Image” tab, paste your string (with or without the data: prefix), and Kotopig previews the image and lets you download it.

Which image formats are supported?

Any raster or vector image your browser can read — PNG, JPG, WebP, GIF and SVG all encode and decode correctly.