How to use Image to Base64
- Choose or drag a supported image into the panel. The file is read in this browser.
- Select Data URL, Raw Base64 or CSS background to match where the result will be used.
- Review the image preview and dimensions, then copy or download the encoded result.
Worked examples
Use the inputs below to compare the selected mode with a known result. Loading an example replaces the current input.
Try a small, known image
Download the toolkit sample SVG, then choose it in the image panel above. Check the preview before copying.
Data URL: data:image/svg+xml;base64,…
CSS: background-image: url("data:image/svg+xml;base64,…");The ellipses show where the full payload belongs; these shortened examples are not usable image data. Use the full result generated from the file.
What this tool does and does not do
The file limit is 10 MiB (10,485,760 bytes). PNG, JPEG, WebP, GIF, SVG, AVIF and BMP are accepted when the browser can decode the file. Encoding does not resize, compress, sanitize or remove metadata from an image.
Conversions run in the current browser. Input drafts are temporary; copy or download important results before leaving. See the privacy policy for the separate handling of visits and preferences.
Common questions
Which mode belongs in an HTML image?
Use the complete Data URL as the img src value. Raw Base64 does not include the media type or data: prefix.
Does Base64 make the image smaller?
No. Each group of 3 source bytes needs 4 Base64 characters, with padding for the final group. A separate image file is often a better choice for a large or reused asset.
Can I reverse this into an image?
This tool encodes selected images only. The separate Base64 text decoder expects UTF-8 text and cannot be used as a general image decoder.