Images TOOL
Image → Base64
Convert an image to a data URL that you can copy.
Choose your files
On-device processingImage → Base64 · How to use
Convert an image to a data URL that you can copy.
Example
Select a PNG image to create a data:image/png;base64,... string.
Things to know
Base64 is typically about one third larger than the original binary. Large images produce large strings.
Choose files: PNG · JPG · JPEG · WEBP
Your files and results are never sent to a server. Everything is processed in this browser.
How to turn an image into a Base64 string for HTML or CSS
Use it to embed a small icon directly in HTML or CSS without a separate file, or to send an image inside a JSON request. The tool checks the file's actual content and adds the matching image/png, image/jpeg or image/webp prefix.
When to use this tool
- Embed a small icon in a CSS background as a data URL
- Include an image directly in an HTML email template
- Send an image as a string in a JSON request body
Step-by-step instructions
- Select a PNG, JPG or WebP image.
- Choose Convert.
- When the data:image/png;base64,... string appears in Result text, choose Copy.
- To keep a long string as a file, download image-base64.txt.
Frequently asked questions
How much larger does Base64 make an image?
Base64 is typically about one third longer than the original. A 30 KB image becomes a string of roughly 40 KB. Shrink large images before converting.
How do I use the result in HTML?
Paste the whole string as the src of an img tag or inside url() in CSS. Keep the data:image/...;base64, prefix so the browser recognizes it as an image.
Is there a file size limit?
PNG, JPG and WebP images up to 6 MB can be converted. Reduce larger photos with the image resizer and try again.