Image to Base64
Turn any image into a Base64 data URI for CSS, HTML or JSON.
Image to Base64
The image to Base64 tool converts any image into a Base64 data URI you can drop straight into CSS, HTML, or JSON. Inlining small images as data URIs removes an extra HTTP request, which is handy for icons, background sprites, email templates, and self-contained documents. Instead of running a command-line encoder, you can generate the string here in seconds.
How it works
The encoding runs locally in your browser with JavaScript. Select an image and it is read directly from your device and converted into a data:image/...;base64,... string, ready to copy. Nothing is uploaded, which means even though you are choosing a local file, the image is processed in memory and never sent to a server.
Practical use cases
- Inline a logo or icon into CSS with a
background-imagedata URI. - Embed an image in an HTML email or a single-file document.
- Store a small image as a string inside a JSON config or fixture.
- Prototype without hosting assets on a separate server.
To decode or preview a Base64 string, use Base64 to Image. For encoding plain text, see Base64 Encode / Decode, and when embedding the result in markup you may find the HTML Entity Encoder useful.
Private by design
Your image is encoded in-browser and is never uploaded. The tool is free, requires no account, and works on all modern browsers including mobile, so you can turn images into Base64 data URIs while keeping your files private on your own device.
Frequently asked questions
Any image your browser can read, including PNG, JPG, GIF, WebP, and SVG, can be converted into a Base64 data URI.
Related tools
Base64 Encode / Decode
Encode text to Base64 and decode it back, with full Unicode support.
Base64 to Image
Preview and download an image from a Base64 or data-URI string.
URL Encode / Decode
Percent-encode and decode URLs and query-string components safely.
HTML Entity Encoder
Encode and decode HTML entities to escape or unescape markup.