Image to Base64 converter
Turn an image into a Base64 data URL, CSS or HTML code.
About the Image to Base64 tool
This tool converts an image file into Base64 text: a data URL (data:image/png;base64,…), plain Base64, a CSS background rule or an HTML <img> tag. It works with PNG, JPG, WebP, GIF, SVG, BMP and ICO files up to 25 MB, and the file is read on your device, not uploaded. Developers use it to put a small logo inside an HTML email, a JSON API request or a single-file web page. Base64 is about a third larger than the file: a 30 KB icon becomes about 40 KB of text.
At a glance
- Input
- PNG, JPG, WebP, GIF, SVG, BMP, ICO or AVIF, up to 25 MB
- Output
- Data URL, plain Base64, CSS background rule or HTML img tag; copy or save as .txt
- Size
- About 33% larger than the file (4 characters for every 3 bytes)
- Price
- Free, no sign-up
- Works in
- Your browser, on phone or computer. Works offline after the first visit.
- Privacy
- Files are processed on your device and never uploaded.
How to convert an image to Base64
- Select or drop an image.
- Choose the output: Data URL, Base64 only, CSS background or HTML <img>.
- Press "Convert to Base64", then copy the text or download it as a .txt file.
Private
Your files are processed in your browser and never uploaded.
Fast
No upload or queue. Results are ready in seconds.
Free
No sign-up, no limits and no watermark on your files.
Image to Base64: frequently asked questions
What is a Base64 image?
A Base64 image is the image file written as plain text, so it can sit directly inside HTML, CSS, JSON or an email. A data URL adds the type in front, for example data:image/png;base64,iVBORw0KGgo…
Why is the Base64 text bigger than the image?
Base64 uses 4 characters for every 3 bytes, so the text is about 33% larger. Example: a 30 KB icon becomes about 40 KB of Base64. Use it for small icons and logos, not large photos.
When should I use "Base64 only" instead of a data URL?
Use "Base64 only" when an API or JSON field asks for the raw Base64 string without the data:image/…;base64, prefix. Use a data URL anywhere a normal image URL is accepted.
Are my files uploaded to a server?
No. This tool runs entirely inside your browser, so your files never leave your device. Nothing is stored or seen by us.



