Image to Base64 Converter
About this tool
Choose an image to create a Base64 data URL that can be used in HTML or CSS. You can also paste a Base64 image value and restore it as an image file. The tool shows the resulting text length and estimated size.
How to use
- Convert an image into a Base64 data URL
- Restore a Base64 data URL as an image file
- Recognize common PNG, JPEG, WebP, and GIF types
- Show the resulting length and estimated size
- Copy the value or download the restored image
- Choose a direction: Select image to Base64 or Base64 to image.
- Add the content: Choose an image or paste a Base64 image value.
- Copy or download: Copy the generated data URL or download the restored image.
Examples
- Embed a small icon in an HTML email template
- Create a default avatar image for a web page
- Restore an image from a copied Base64 value
- Test a background image without hosting a separate file
Limitations
- Base64 usually increases the amount of text by about one third
- Very large images can produce long values that are unsuitable for embedding directly in a webpage
- The selected image or entered Base64 value is processed directly in your browser and is not sent to a server.
FAQ
- What is the difference between a data URL and raw Base64?
- A data URL includes a MIME type prefix such as data:image/png;base64,...; raw Base64 contains only the encoded content.
- What image size is recommended?
- Keep source images under a few hundred KB; very long data URLs can slow page loading.
- Can I decode from CSS url()?
- Paste the data URL portion; the tool removes the prefix if present.