Convert images to Base64 encoded strings online for free. Generate data URIs for embedding images directly in HTML, CSS, and JavaScript. No signup required.
First time here? Upload or drag an image Your input is processed locally and disappears when you close the tab.
Inlining small images directly in your markup removes extra network requests and keeps assets bundled with your code. Our free image to base64 converter encodes any image into a Base64 string and a ready-to-paste data URI, so you can embed icons, logos, and simple graphics straight into HTML, CSS, or JavaScript.
Upload a PNG, JPEG, WebP, GIF, SVG, or BMP and instantly get four outputs: the raw Base64, a complete data URI with the correct MIME type, an HTML <img> tag, and a CSS background-image rule — each with one-click copy or download as a .txt file. This makes it easy to embed an image as Base64 or drop an inline image into HTML without juggling separate files. The tool reports the original versus encoded size and warns when a file exceeds 1 MB, since Base64 adds roughly 33% overhead and large inline assets can bloat your pages.
Everything is encoded locally in your browser and is never uploaded, keeping private graphics on your device. For plain text or file encoding, use our Base64 Encoder / Decoder; to convert Base64 back into an image, try the Base64 Image Encoder / Decoder; and the Image Compressor helps shrink images before inlining.
Upload or drag an image
The Base64 string generates automatically
Copy the data URI for HTML/CSS embedding
Or copy just the raw Base64 string
Drop an image or click to upload
Encoded locally · never uploaded