Image to Base64

Convert an image to a Base64 data URI, or turn Base64 back into an image — in your browser.

100% private — runs entirely in your browser. Your data is processed on your device and never sent to the internet.

Click to upload or drop an image

PNG, JPG, GIF, WebP or SVG — encoded in your browser

About this tool

Encode any image to a Base64 data URI so you can embed it directly in your HTML, CSS or JSON — no separate image file or extra HTTP request. Or go the other way and decode a Base64 string back into an image you can preview and download.

It works with PNG, JPG, GIF, WebP and SVG, gives you the string with or without the data:image/…;base64, prefix, and can copy it as a ready-to-paste CSS background rule. Everything runs in your browser — your image is never uploaded.

Features

  • Two-way — image → Base64, and Base64 → image
  • With or without the data-URI prefix
  • Copy as CSSbackground-image: url("…")
  • Download the decoded image back out
  • Private — encoding and decoding happen on your device

How to use it

  • Image → Base64 — upload an image, then copy the Base64 string (toggle the data-URI prefix on or off)
  • Base64 → Image — switch mode, paste a data URI or raw Base64, then preview and download the image
  • Use Copy as CSS background to paste straight into a stylesheet

Frequently asked questions

When should I inline an image as Base64?

Small icons, logos and backgrounds are good candidates — inlining removes an HTTP request. Large images are usually better left as normal files, since Base64 is about 33% bigger than the original bytes.

Is my image uploaded?

No. The conversion runs entirely in your browser.

More tools

View all