Image to Base64
Turn an image into a Base64 data URI you can paste into HTML, CSS or code.
Free, with no account needed. It runs in your browser, so your file never leaves your device.
Select image
or drop it here — JPG, PNG, WebP, GIF, BMP, TIFF or HEIC · up to 25 MB
About Image to Base64
Image to Base64 turns a picture into a data URI, a long line of text that starts with data:image. You can paste it straight into HTML, CSS or JSON instead of linking to a file.
Last reviewed
How to use it
- Select the image.
- Press Convert to Base64.
- Download the text file, or copy the data URI from it.
When to use it
- Embedding a small logo or icon directly into an HTML email template.
- Putting an image inside a JSON payload or a configuration file for an API.
- Testing an image in CSS without hosting it anywhere.
Good to know
- The image is encoded exactly as uploaded, so the data URI is about a third larger than the file.
- Use it for small images such as icons. Large images make pages heavy and are better served as normal files.
- The result looks like data:image/png;base64, followed by the encoded data.
Tips for a better result
- Use it for small images, roughly under 10 KB. Large data URIs make pages and emails slow.
- Compress or resize the image first, since the Base64 text is about a third larger than the file.
- Some email programs block data URIs. Test the email in the programs your readers use.
Questions about Image to Base64
- How do I use the data URI in HTML?
- Paste it as the src of an image tag: <img src="data:image/png;base64,...">. In CSS use it inside url().
- Why is the Base64 text bigger than my image?
- Base64 represents binary data using only text characters, which adds roughly one third to the size.
- How much does Image to Base64 cost?
- Image to Base64 is free, and you don't need an account. It runs inside your browser, so it costs us nothing to run and there are no credits to spend.
- Is my file kept after I use Image to Base64?
- Your file never leaves your device. Image to Base64 works inside your browser, so nothing is uploaded and there is nothing for us to keep.
- Do I need an account to use Image to Base64?
- No. Image to Base64 works without an account or sign-up. Open the page, choose your file and download the result.
- Does Image to Base64 work on a phone?
- Yes. Image to Base64 runs in the browser on phones, tablets and computers, with nothing to install. A very large file can be slow on an older phone, because your own device does the work.
- Is there a file size limit for Image to Base64?
- We set no upload limit, because nothing is uploaded: the limit is your device's memory. If your browser can't process a file, the page offers to process it on our servers instead. That uses credits and accepts files up to 25 MB.