How to convert an image to Base64
Base64 turns a small image into text so it can be embedded directly in code instead of loaded as a separate file. This is handy for tiny icons and email templates.
Step by step
- Add your file. Drag it into the box or click the box to choose it from your device.
- Choose your settings. Set the options you need. The tool tells you if something is not supported.
- Process and download. Press the button, check the result and download it.
Tips for better results
- Only embed small images; Base64 is about one third larger than the original file.
- Choose “Data URL” for use in an <img src> or CSS url().
- Large images make HTML and CSS slow to load, so link them as files instead.
Limits to know
- Formats: JPG, PNG, WebP, GIF, BMP
- Size: 5 MB
- Notes: Large images produce very long text and are rejected.
At a glance
| Tool | Image to Base64 |
|---|---|
| Category | Image Tools |
| Works with | JPG, PNG, WebP, GIF, BMP |
| Size limit | 5 MB |
| Where it runs | In your browser tab; your input is not uploaded |
| Cost | Free, no sign-up |
Frequently asked questions
What is a data URL?
It is the Base64 text with a prefix such as data:image/png;base64, so a browser can show it directly.
Is there a size limit?
Images up to 5 MB are accepted here, because the text output becomes very long.
If something does not work
- The file is rejected. Check that it is one of the supported formats (JPG, PNG, WebP, GIF, BMP) and within the size limit (5 MB).
- Nothing downloads. Your browser or an extension may block downloads. Allow downloads for this site and press the button again.
- The tool says a library failed to load. The helper libraries come from a public CDN, so check your internet connection and reload the page.
- The result looks different from what you expected. Read the limits above; this tool does not recreate everything in the original file.
Still stuck? Use Report a Problem and tell us the tool, your browser and what happened, or read the Help Center.
Related tools and guides
- JPG to PDF: Combine one or more images into a single PDF. Reorder them, choose the page size and margins, and download. Read the guide
- Scan to PDF: Turn photos of paper documents into a clean PDF. Take pictures with your phone camera or add images, clean them up (document… Read the guide
- Image Resizer: Change the pixel size of a JPG, PNG or WebP image: type exact numbers or drag handles on the picture to make it smaller or… Read the guide
More tools like this are in Image Tools, or browse all tools.