Convert any JPEG, PNG, WebP, GIF or SVG to a Base64 data URL, raw string or CSS background-image declaration. Runs entirely in your browser — nothing uploaded.
Drop a JPEG, PNG, WebP, GIF or SVG onto the converter and the browser turns it into a Base64-encoded data: URL without sending a single byte to a server. The encoded string carries the full image, which means it can live directly inside an HTML src= attribute, a CSS background-image declaration, a Markdown image reference, or a JSON payload anywhere a file path is not an option.
The most common use is embedding a small logo or icon in an HTML email, where external images are blocked by default. A second common case is loading states: a tiny blurred Base64 placeholder can ship inside the initial HTML while the full-resolution image loads, eliminating the blank-box flash. Both rely on the same conversion this tool produces. Once generated, the output works in every modern browser without any additional libraries.
data:image/…;base64,… string, Base64 string for the encoded payload without the prefix, or CSS background for a ready-to-paste background-image: url(…); declaration.<img src="data:…" alt="filename" /> tag in one click — useful for dropping the image directly into a static HTML file without building the tag by hand.data:image/svg+xml;base64,… and data:image/webp;base64,… are produced automatically without manual editing..jpg still encodes it as image/png.Base64 encoding adds roughly 33% to the original file size: every 3 bytes become 4 ASCII characters. The encoded size and output character count are shown alongside the original file size so you can judge whether inlining is practical before copying. Images over 100 KB trigger an advisory. Base64-inlining large images often increases page weight more than a normal <img src="url"> request would, because the browser cannot cache a data: URL separately from the HTML document that contains it.
Drop an image here, or click to browse
JPEG · PNG · WebP · GIF · SVG · max 8 MB · nothing is uploaded
Select an image above to see its Base64 output.
The encoded string is generated entirely in your browser.