🖼
Image to Base64
Several images at once · paste, drop or browse · size check · Base64 back to an image
🖼 Click, drag or paste (Ctrl+V) images here PNG · JPG · GIF · WebP · SVG · ICO · AVIF — several at once

Image to Base64 Encoder

Free online image to Base64 converter. Drop, paste or browse for one or more images (PNG, JPG, GIF, WebP, SVG, AVIF) and get each one's data URL, raw Base64, HTML img tag, CSS background-image and Markdown — with a warning when an image is too big to inline. Switch tabs to turn Base64 back into an image you can download. Fully client-side — images never leave your browser.

Free No login 100% browser-based Your input never leaves your device

Try these next

What is a Base64 Image Encoder?

A Base64 data URI embeds binary file data — like an image — directly into an HTML or CSS file as text. Instead of a separate HTTP request for the image, the browser decodes the embedded data. This reduces HTTP requests and is useful for small icons, inline images in email templates, and embedding images in JSON API responses.

This tool converts images (PNG, JPEG, GIF, WebP, SVG) to Base64 data URIs entirely in your browser using the FileReader API. The file is never uploaded — it is read from disk locally. The output includes the correct MIME type prefix ready to paste directly into CSS background-image or HTML img src attributes.

What is a Base64 data URL?
A Base64 data URL embeds the image data directly in the URL string, eliminating the need for a separate HTTP request. The format is: data:[mediatype];base64,[data]. For example: data:image/png;base64,iVBORw0KGgo... They're used in HTML <img> src attributes, CSS background-image values, and email HTML to embed images without external files.
Does Base64 encoding increase image file size?
Yes — Base64 encoding increases the data size by approximately 33%. A 100KB image becomes roughly 133KB when Base64-encoded. For this reason, Base64 is best for small images (icons, logos under 10KB). For large images, external file references are more efficient for page load performance.
What image formats are supported?
This tool supports all common image formats that browsers can display: PNG, JPEG/JPG, GIF, WebP, SVG, ICO, and BMP. The Base64 output includes the correct MIME type for each format so the data URL works immediately in HTML and CSS.
Can I use Base64 images in CSS?
Yes: .element { background-image: url("data:image/png;base64,YOUR_DATA"); }. This is commonly used for small icons, sprites, and loading placeholders to eliminate HTTP requests. Avoid for large images — inline Base64 can't be cached by the browser separately, so it's downloaded on every page load.
Does Base64 make my images load slower?
It depends on usage. Inline Base64 eliminates the HTTP request (good for very small images, 1–4KB), but the Base64 string is ~33% larger than the original binary and it can't be cached separately from the page or stylesheet that contains it. For images over 4KB, a standard <img src="..."> with HTTP caching is almost always faster.
What is the maximum image size I can convert?
This tool accepts images up to 20 MB each and converts them entirely in your browser. The Base64 text is about 33% larger than the file, and data URLs of several megabytes make HTML and CSS files slow to load and edit, so Base64 is best kept for small images such as icons and logos.
Can I embed SVG as Base64 or should I use inline SVG?
SVG can be embedded as Base64 (data:image/svg+xml;base64,...) but it's usually better to either use inline SVG (<svg>...</svg> directly in HTML) or a data URI without Base64 (data:image/svg+xml,<url-encoded SVG>). Inline SVG is the most flexible option as it can be styled with CSS and animated with JS.
✓ Copied!