Turn an image into a Base64 data URL
Drop in a small image and copy a data URL. Paste it into HTML, CSS or JSON.
Small images under 100 KB make the best data URLs.
This runs in your browser. Your file is not sent to us.
How to use image to base64
- Add the image. Drop one file in. Small images under 100 KB work best.
- Copy the form you need. A full data URL, raw Base64, an HTML tag or a CSS rule.
- Paste it in your code. The image loads with no extra request to a server.
What you get
- Full data URL and raw Base64, both ready to copy
- Snippets for HTML img tags and CSS backgrounds
- Shows the size cost, so you know when it is worth it
- Works with JPG, PNG, WebP, GIF and SVG
Why this runs in your browser
Most free PDF sites ask you to upload your file. Then you wait. Then you hope they delete their copy. That is a bad deal for a payslip, a contract or a passport scan.
Image to Base64 reads the file on your device and saves the result to your downloads folder. There is no upload and no copy on a server. For the details, see how it works.
Image to Base64 questions
What is a Base64 data URL?
It is the whole image written as text. The browser can show it without asking a server for a file.
When should I use one?
For small icons and badges that appear on every page. One fewer request can make a page feel faster.
When should I not use one?
For big photos. Base64 makes a file about a third bigger. Keep large photos as normal files.
Can this break my email template?
Some email clients block data URLs. Test first, or link a hosted image instead.