Loading tool…

Image to Base64 Converter

Image to Base64 converter — drop any common image format and copy Base64 or a Data URI instantly.

How to use Image to Base64 Converter

  1. 1. Drop the image. File mode is pre-selected on this page.
  2. 2. Pick a snippet. Raw, Data URI, HTML, CSS, or JSX.
  3. 3. Copy. Nothing leaves your browser.

About this tool

Converter-style queries (“image to base64 converter online”) map to the same File encode workflow with image-focused copy and snippets.

Supported formats

PNG, JPEG, WebP, GIF, SVG, ICO, and AVIF (browser support for AVIF varies).

Code examples

Node

Buffer.from("hello").toString("base64");
Buffer.from(b64, "base64").toString("utf8");

Browser (UTF-8 safe)

btoa(unescape(encodeURIComponent(text)));
decodeURIComponent(escape(atob(b64)));

Python

import base64
base64.b64encode(b"hello").decode()  # aGVsbG8=
base64.b64decode("aGVsbG8=").decode()

Data URI

const uri = `data:image/png;base64,${b64}`;
// <img src={uri} /> or CSS url('${uri}')

This is one direction of Base64 Studio. The editor is the same; the title and default direction match this search.

Frequently asked questions

Related tools

All tools