Image tool / 16
Image to Base64
Encode an image as a complete Base64 data URL for CSS, HTML, or transport.
Image to Base64: TOEA reads the file bytes with the browser FileReader and prefixes the Base64 payload with its MIME type. Runs 100% locally in your browser with zero server file uploads.
- Category
- Image tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
JPG, PNG, WebP, or GIF · up to 30 MB
When inlining pays off
A data URL saves a request but cannot be cached on its own: it is downloaded again with every copy of the HTML or CSS that contains it, and it is about a third larger than the file. That trade works for tiny images of a few kilobytes, such as an icon in a stylesheet or a blurred placeholder. Photos and images reused across pages load faster as ordinary files. For SVG, URL-encoding the markup instead of Base64 usually gives a shorter data URL.
Where data URLs do not work
Gmail and many other email clients do not display images embedded as data URLs, so in newsletters link to a hosted image instead. Many APIs that accept Base64 images want only the payload: delete everything up to and including the comma after base64. A page with a Content Security Policy must list data: in its img-src directive before inline images will load.
How to use it
- Choose an image.
- Encode it locally.
- Copy the resulting data URL.
Privacy & limitations
The file stays on your device. Base64 is an encoding, not encryption, and increases size by roughly one third.
Related tools
Frequently asked questions
Can I paste this into an img tag?
Yes. The full data URL can be used as an image src where data URLs are allowed.
Why is the result longer than the file?
Base64 represents binary bytes with text characters and adds overhead.
Free tool · runs in your browser · no account required