Image to Base64
Turn an image into a Base64 data URL you can paste into HTML, CSS or JSON.
How to convert an image to Base64
Add your image
Drop an image onto the box, or choose it from your device.
Convert
Press Convert to Base64.
Copy
Paste the data URL into your HTML, CSS or JSON.
Base64 makes the data larger, so it suits small icons and graphics.
When to use Image to Base64
You want a small icon inside an HTML page, a style sheet or a JSON file without a separate file to load.
An email template or a test fixture needs an image as a text string.
Tips for a better Image to Base64 result
Use it for small images, such as icons and logos, where one fewer request is worth a slightly bigger page.
Copy the whole data URL, including the part at the start that names the image type.
Image to Base64: limits and what to check
Base64 makes the data about a third larger than the image, so large pictures are better kept as normal files.
Embedded images cannot be cached on their own, so the text is downloaded with the page each time.
About Image to Base64
Turn an image into a Base64 data URL so it can be embedded directly in HTML, CSS or JSON without a separate file. Base64 makes the data larger than the original image, so it suits small icons and graphics best.
FAQs
When should I use a data URL?
For small images that you want inside the page itself, such as icons. Large images are better as normal files.
Can I turn Base64 back into an image?
Yes. Use Base64 to Image.