Image ↔ Base64
Convert images to Base64
The essentials
The Image ↔ Base64 converter turns images into Base64 data strings for embedding in HTML, CSS, or JSON — and decodes Base64 back into viewable images.
How to use it
- Upload an image to encode, or paste a Base64 string to decode.
- Copy the generated data URI or download the decoded image.
Pro tips
- Base64 adds about 33% to file size — use it only for small icons and logos.
- Prefix the string with data:image/png;base64, when embedding in HTML.
- For larger images, a regular file or CDN link is faster for browsers.
Behind the result
Encoding reads the file as binary and converts it to a Base64 text string using the browser's own encoders; decoding reverses the process. Base64 inflates size by about 33%, which is why it suits small assets only.
A worked example
You need to inline a tiny icon in a CSS file without an extra request.
- Input
- A 4 KB PNG icon.
- Output
- A data:image/png;base64 string of about 5.5 KB, ready to paste.