Image to Base64
Encode an image into a Base64 string for embedding in code, or decode a Base64 string back into a downloadable image.
Frequently asked questions
What is a Base64 image string used for?
It’s a way to embed image data directly inside text — HTML, CSS, JSON, or code — instead of linking to a separate file. Common uses include inline CSS background images and embedding small icons directly in HTML.
Does the encoded string include the data:image prefix?
Yes, the output is a complete data URI (e.g. starting with data:image/png;base64,...) that you can paste directly into an HTML src attribute or a CSS url().
Can I decode Base64 that’s missing the data:image prefix?
Yes — paste just the raw Base64 characters and the tool will assume PNG and add the prefix automatically before decoding.