Image to Base64 · Base64 to image

Image to Base64 converter that runs in your browser

Free and private: nothing is uploaded. Data URI, HTML and CSS snippets in one drop.

Encoding and decoding happen on your device. Only the optional AI extras upload an image, and it is deleted after 24 hours.

Drop images here, or paste with Ctrl+V

PNG, JPG, GIF, WebP, SVG, AVIF, BMP or ICO · up to 25.0 MB each · 20 at a time

Runs in your browser. Nothing is uploaded.

  • Free, no sign-up
  • Up to 25 MB per image
  • 20 images at a time
  • PNG · JPG · GIF · WebP · SVG · AVIF · ICO

New accounts get 4 free credits once, after verifying their email address. Enough for one AI alt text (4 credits).

Outputs

Copy it the way your code needs it

One drop gives every format. Pick a tab, copy, done.

  • Plain Base64, for APIs and JSON fields

    iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…

  • Data URI, for any src or url()

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…

  • HTML <img> tag with width, height and alt

    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…" alt="…">

  • CSS background-image rule

    .icon { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…"); }

  • JSON object with name, type and data

    { "name": "icon.png", "dataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…" }

  • Markdown image

    ![…](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…)

  • Favicon <link> for the page head

    <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…">

Options: URL-safe alphabet, 76-character line wrap, SVG as a smaller UTF-8 data URI, and a .txt download of any output.

Size check

Should you inline this image?

Base64 makes a file about 33% bigger, and a data URI can't be cached apart from the page that holds it. Each result gets a verdict:

Under 10 KB: inline it. Icons, tiny logos and email images load with the page.

10 to 32 KB: only for something the first paint needs.

Over 32 KB: keep it a file and link to it.

Too big? The shrink panel re-encodes the image as WebP or JPEG at the size you set, still in your browser.

Optional AI extras

Finish the asset before you paste it

Three small jobs that use credits. They are the only part of the site that uploads your image, after you confirm you may use it, and inputs and results are deleted after 24 hours.

Alt text

A short and a long description from Gemini (Google), dropped straight into the <img> and Markdown snippets.

4 credits

The base64img.com logo, used as the alt text samplealt="A minimalist icon representing a digital card or post layout on a dark teal background."
Real result on our own logo

Background removal

Turns a logo or product shot into a transparent PNG with Recraft, ready to encode.

10 credits

The base64img.com logo printed as a sticker on a sand-coloured desk

Before

The same sticker cut out on a transparent background

After

Real result on our own logo

Icon upscale

Makes a small icon (up to 1024 px) sharper and larger with Recraft Crisp Upscale.

12 credits

The base64img.com icon at 128 px

Before · 128 px

The same icon upscaled to 512 px

After · 512 px

Real result on our own logo

Asset Pipeline runs an extra on up to 50 images at once and exports more than 20 encoded files as one ZIP, CSV or CSS sheet. Encoding itself is free on every plan.

base64img.com is independent and not affiliated with Google or Recraft. Gemini and Recraft are trademarks of their owners.

How it works

How to convert an image to Base64

Three steps, all in your browser.

Have a Base64 string? Turn it back into an image
  1. 01

    Drop, paste or pick

    Drop up to 20 images, paste one with Ctrl+V, or fetch one by URL. Each can be up to 25 MB.

  2. 02

    Pick the output

    Base64, data URI, HTML, CSS, JSON, Markdown or favicon. The size check tells you whether inlining is a good idea.

  3. 03

    Copy or download

    Copy with one click or save a .txt. Shrink it first, or add AI alt text if you want it in the tag.

Pricing

Free converter. Credits only for AI extras.

New accounts get 4 free credits once, after verifying their email address. Enough for one AI alt text (4 credits). Encoding and decoding run in your browser and stay free. A plan or a pack buys credits for alt text, background removal and upscale.

Cancel any time · first payment refundable within 5 days

Purchases are paused for now.

Inline

For alt text and the odd cut-out on a side project.

$5.33/ month

1,617 credits a month

≈ 404 alt texts or 161 background removals

  • Image to Base64 and back: free
  • AI extras at once: 2
  • AI extras one image at a time; export up to 20 files

Sprite Sheet

Popular

For front-end work that needs AI extras every week.

$16.73/ month

5,742 credits a month

≈ 1,435 alt texts or 574 background removals

  • Image to Base64 and back: free
  • AI extras at once: 3
  • AI extras one image at a time; export up to 20 files

Asset Pipeline

For icon sets and design systems: batch AI and big exports.

$35.47/ month

12,836 credits a month

≈ 3,209 alt texts or 1,283 background removals

  • Image to Base64 and back: free
  • AI extras at once: 6
  • Batch AI on up to 50 images, export 200 files at once

What a credit buys

Each price shows before you run. A job that fails or is refused is refunded in full.

Credits per job
JobCredits
Encode, decode, snippets, SVG mode, shrink0
Alt text · Gemini4
Background removal · Recraft10
Upscale · Recraft Crisp Upscale12

Models behind each credit

  • Alt text: Gemini (Google).
  • Background removal: Recraft (Recraft).
  • Upscale: Recraft Crisp Upscale (Recraft).

base64img.com is an independent site and is not affiliated with Google or Recraft.

Changed your mind? Packs can be refunded within 14 days and a plan's first payment within 5 days, while no more than 10% of the credits are used; the unused part is refunded.

FAQ

Image to Base64 questions

Is the image to Base64 converter free?

Yes. Converting images to Base64 and back is free, with no account and no daily cap, because it runs in your browser. Only the optional AI extras use credits: alt text 4, background removal 10, upscale 12. New accounts get 4 free credits once, after verifying their email address.

Is my image uploaded anywhere?

No. Encoding, decoding, the size check and shrinking all run on your device. An image only leaves it if you run an AI extra and confirm you may use the image; that copy is deleted after 24 hours.

Why is the Base64 string bigger than my file?

Base64 writes every 3 bytes as 4 characters, so it is about 33% larger, plus a few characters for the data URI prefix. Gzip on your server wins some of that back.

Should I inline images as data URIs?

For small images, yes: under about 10 KB a data URI saves a request. Above 32 KB it bloats your HTML or CSS and can't be cached on its own, so link the file. The verdict on each result tells you which side you are on.

SVG: Base64 or URL-encoded?

Usually URL-encoded UTF-8: it is shorter and still readable. The SVG switch shows both lengths and marks the smaller one.

My Base64 string won't decode. What's wrong?

Most often it was cut off when copied, or it has stray characters. The decoder accepts data URIs, URL-safe Base64, CSS url() and <img> tags, adds missing padding, and points to the exact position of a bad character.

Which formats work?

PNG, JPG, GIF, WebP, SVG, AVIF, BMP, ICO and TIFF are detected from the bytes, whatever the file name says. Images up to 25 MB each, 20 at a time.

What do the AI extras do, and which models run them?

Alt text comes from Gemini (Google) for 4 credits. Background removal uses Recraft (10 credits) and upscale uses Recraft Crisp Upscale (12 credits). A failed run is refunded. base64img.com is independent and not affiliated with these companies.

What does the Asset Pipeline plan add?

Encoding and decoding run in your browser and stay free. Asset Pipeline adds batch AI (alt text, background removal or icon upscale on up to 50 images at once) and one-click export of more than 20 files as a ZIP, CSV or CSS sheet.

Last updated: