How to use Image to Base64 Converter
- 1. Drop the image. File mode is pre-selected on this page.
- 2. Pick a snippet. Raw, Data URI, HTML, CSS, or JSX.
- 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}')