About the Image to Base64 Converter
Base64 encoding turns binary image data into plain text characters. The Image to Base64 Converter creates a data URI that you can embed directly in HTML, CSS, JSON, emails or JavaScript, removing the need for a separate image file and an extra HTTP request.
Embedding is handy for small icons, logos in HTML email templates, single-file demos, and storing images inside JSON APIs. Choose between the full data URI, the raw Base64 string, an HTML <img> tag or a CSS background-image rule. Keep in mind that Base64 is about 33% larger than the original file, so it is best suited to small images.
How to use the Image to Base64 Converter
- Upload, drop or paste an image.
- Pick the output format: data URI, raw Base64, HTML or CSS.
- Click Copy code.
- Paste it into your HTML, CSS or code.
Frequently asked questions
Why is the Base64 output bigger than my image?
Base64 represents every 3 bytes with 4 text characters, so the encoded text is roughly 33% larger than the original file.
Is it good for SEO to embed images as Base64?
For large images, no: they cannot be cached separately or indexed in image search. Use Base64 mainly for tiny icons and emails.
How do I convert Base64 back to an image?
Use our Base64 Encoder/Decoder or paste the data URI into your browser address bar to view and save it.
