Image to Base64 & Base64 to Image

Embed a small image directly in HTML or CSS, or decode a Base64 string back into a picture. Processing happens in your browser tab. The page makes no upload requests for your files, and the site’s security policy only allows connections back to tools.gift itself.

  • Free, no sign-up
  • Runs in your browser
  • Verified

Images are converted on your device and never uploaded.

Image to Base64 data URL


Base64 to image

How to use it

  1. To encode: choose an image and copy the data URL, an <img> tag or a CSS rule.
  2. To decode: paste a data URL or raw Base64 and download the image.

How it works

A data URL is the text “data:” followed by the file type and the file’s bytes in Base64. Base64 turns every 3 bytes into 4 characters, so the text is about 33% larger than the file. Decoding checks the first bytes of the data to identify PNG, JPEG, GIF or WebP, and then loads it as an image.

Examples

  • A 2 KB icon becomes about 2.7 KB of text that can sit directly inside a stylesheet.

Limitations

  • Data URLs suit only small images: large ones bloat the page and cannot be cached separately. Images over 3 MB are refused.
  • SVG images are not decoded here for safety, because SVG can contain scripts.
  • Base64 is an encoding, not encryption.

Last verified . See our Accuracy & Editorial Policy. Found a problem? Email contact@tools.gift.