Drag & drop, paste (Ctrl+V) or click to choose images
Supports any image format: JPG, PNG, WEBP, GIF, SVG…
Key benefits
- •Runs 100% in your browser: your image never leaves your device
- •Get a ready-to-use data URI (data:image/...;base64,...) for CSS, HTML or JSON
- •Works with any image your browser can open: JPG, PNG, WEBP, GIF, SVG and more
- •Download the Base64 string as a .txt file to keep or share
Common uses
- •Embed small icons and logos in CSS with background-image: url(data:image/...) to save HTTP requests
- •Include images in HTML emails, JSON configs or API docs without hosting them separately
- •Prototype a UI with sample images without uploading them to a CDN or server
Working out the real cost
Base64 turns every 3 bytes into 4 characters, so a 30 KB image becomes a string of about 40 KB. Gzip or Brotli on your server wins some of that back, but the bigger cost is caching. An image file is cached once and reused across pages, while an embedded string is downloaded again inside each page or stylesheet that contains it.
A sensible rule is to inline only tiny images, such as a small icon or placeholder of a few KB, and to link anything larger as a normal file.
Where embedding makes sense
HTML email is a mixed case: it avoids hosted images, but several major email clients, including Gmail, don't display data URIs, so test it before you send a campaign. Single-file reports and JSON payloads are better fits, since the receiver gets everything in one document with no separate upload step.
Remember the MIME type. A data URI needs the right prefix, such as data:image/png;base64, and a mismatch can stop an image from showing. Base64 is an encoding and not encryption, so anyone can decode the string back into the original image.
Frequently asked questions
What is a Base64 image?
It's the image's binary data written out as plain text (letters, digits and a few symbols), so you can embed the image directly in HTML, CSS or JSON instead of linking to a separate file.
Is my image uploaded to a server?
No. The image is read and encoded in your browser with the FileReader API and never leaves your device. (Most other tools on this site do upload files to our server for conversion.)
Where can I use the Base64 string?
In the src attribute of an <img> tag, in url() in CSS, or anywhere that accepts a data URI. The string already includes the data:image/...;base64, prefix, so it works as is.
Why shouldn't I Base64-encode large images?
A Base64 string is about 33% larger than the original file, and the browser has to download it as part of the page instead of loading the image in parallel. Base64 suits small images like icons and logos; keep large photos and banners as regular files.
Helpful articles
Read the blog →How to Add a Favicon to Your Website: HTML, WordPress & More
Copy-paste favicon HTML, where the files go, and the steps for WordPress, Shopify, Wix, React and Next.js.
Favicon Size and Format Guide: ICO, PNG or SVG?
The favicon sizes every site needs, why favicon.ico still matters, and when an SVG favicon is the better choice.

What Is a HEIC File? iPhone Photos Explained
Your iPhone saves photos as HEIC, not JPG. Here's what the format is, what it does better than JPG, and why it causes so much trouble outside Apple devices.
Related tools
All tools →SVG code to image
Paste SVG code, export a PNG/JPG/WEBP image
IMAGESVG CODEImage to SVG code
Upload an image, get <svg> code to copy
PNGWEBPPNG to WEBP
Convert heavy PNG images to lightweight WEBP files that keep their transparent backgrounds.
JPGWEBPJPG to WEBP
Convert JPG photos to high-quality WEBP files for sites and apps that need the format.