Image to Base64
Convert any image to a Base64 data URI – right in your browser.
Drag & drop a file here, or click to browse
Max 10 MB. The file is converted in your browser and never uploaded.
Convert Images to Base64 Online
Turn any picture into a Base64 string or a ready-to-use data URI in one step. Drop an image on the box above (or click to browse) and the tool instantly shows a preview, the file size, the encoded size, and the Base64 output. Everything happens locally in your browser — no upload, no sign-up, no watermark.
Output formats
- Data URI –
data:image/png;base64,iVBOR..., usable anywhere a URL is expected. - Base64 only – the raw string without the prefix, for APIs and JSON payloads.
- HTML tag – a complete
<img src="data:...">element with an alt text. - CSS background –
background-image: url("data:...")for stylesheets. - Markdown –
for README files and notes. - JSON – file name, MIME type, size, and Base64 in one object.
Why embed images as Base64?
Inlining small graphics reduces the number of HTTP requests, which can speed up the first paint of a page. It's also the easiest way to ship icons inside a single HTML file, an email signature, a browser extension, or a JSON API response. Many front-end build tools (webpack, Vite) inline images below a size limit for exactly this reason.
Keep in mind that Base64 makes data roughly one third larger, and inline images can't be cached independently. As a rule of thumb, inline files under 5–10 KB and keep larger photos as regular files. Before converting, it's worth compressing or resizing the image first — every byte you save in the original saves about 1.33 bytes in the encoded string.
Related tools
Need a specific format? Try PNG to Base64, JPEG to Base64, or SVG to Base64. To go the other way, paste a string into Base64 to Image.
Frequently Asked Questions
Are my images uploaded to a server?
No. The image is read and converted with JavaScript inside your browser. It never leaves your device, so the tool also works for private screenshots and unreleased designs.
Which image formats are supported?
Any format your browser can open: PNG, JPEG, GIF, WebP, AVIF, SVG, BMP, ICO, and APNG. The MIME type in the data URI is taken from the file, so the result works directly in HTML and CSS.
When should I use a Base64 image instead of a normal file?
Inline Base64 is great for small icons, logos, and placeholders (a few kilobytes) because it saves an HTTP request and works in emails and single-file HTML. For large photos, a normal image file is better: Base64 is about 33% bigger and can't be cached separately by the browser.
Do Base64 images work in HTML emails?
Partly. Apple Mail, iOS Mail, and many webmail clients display data URI images, but Gmail and some Outlook versions block or strip them. For newsletters, hosted images or CID attachments are more reliable; data URIs are fine for internal tools and signatures you have tested.