Image to Base64
Encode an image as Base64 for embedding directly in HTML, CSS or JSON — or paste a Base64 string to preview and download the image inside it.
Drag and drop an image here
or click to browse — PNG, JPG, GIF, WebP, SVG, ICO
Your files are processed locally in your browser and are not uploaded to our servers.
How to use image to base64
- 1Choose Image → Base64 and drop in an image, or Base64 → Image and paste a string.
- 2For encoding, pick the output: data URL, raw Base64, an HTML <img> tag or a CSS background rule.
- 3Copy the result, or download the decoded image.
About this tool
Base64 turns binary files into plain text, so an image can live inside an HTML file, a CSS stylesheet, a JSON payload or an email without a separate download. It's handy for small icons and placeholders, and for APIs that only accept text.
The trade-off is size: Base64 is about 33% bigger than the original file and can't be cached separately by the browser, so it's best for small images. The tool shows exactly how much larger the encoded version is.
Decoding accepts a full data URL or bare Base64 (with or without line breaks, including URL-safe Base64) and checks the bytes to identify the real image type — even if the data URL claims a different one. Nothing is uploaded; images are read and encoded in your browser.
Frequently asked questions
Base64 represents every 3 bytes of the file with 4 text characters, so the result is about 33% larger. That's the cost of making binary data safe to paste as text.
Related tools
Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text.
SVG to PNG
Convert SVG vector graphics to PNG at any size, with transparency.
URL Encode / Decode
Percent-encode text for URLs, or decode it back.
Favicon Generator
Generate a complete favicon package — favicon.ico plus PNG icons — from one image.
Image Compressor
Shrink JPG, PNG and WebP files without losing quality.