Image to Base64
ConvertConvert an image to a Base64 data URI for inline use in CSS, HTML, or JSON. Decode Base64 back into a downloadable image too. Runs locally.
Runs entirely in your browser. Nothing is uploaded.
Encode images as data URIs
A Base64 data URI turns an image into a string of text you can paste directly into a stylesheet, an HTML attribute, a JSON payload, or an email template. That removes one network request and keeps a small asset travelling with the code that uses it. This converter builds the data URI in the page, which matters when the image is a private asset, and it also runs in reverse to turn a Base64 string back into a downloadable file.
How to convert an image to Base64
- 1
Drop in an image
Add a JPG, PNG, WebP, SVG, or GIF file and it is read locally by your browser.
- 2
Copy the data URI
Take the complete `data:` string, ready to paste into CSS, an img tag, or a JSON field.
- 3
Or decode instead
Paste an existing Base64 string in the other direction to get the image file back.
Good to know
- Base64 encoding adds roughly 33% to the byte size, so it is a win for small assets like icons and a loss for large photographs.
- The output includes the correct MIME type prefix, so it works as-is in `background-image` and `src` attributes.
- Inlined images cannot be cached separately from the file that contains them — keep that in mind for anything reused across pages.
- Encoding is local, so a private logo or signature image is never transmitted.
What people use it for
- Inlining a small icon or logo in CSS to remove an HTTP request
- Embedding an image in a JSON payload or an API request body
- Putting a signature or header graphic directly into an HTML email template
Frequently asked questions
What is a Base64 data URI used for?+
It lets you embed an image directly in HTML, CSS, or JSON without a separate file request: handy for small icons, email templates, and inline SVGs.
Can I decode Base64 back to an image?+
Yes. Switch to the Base64 → Image tab, paste a data URI, preview it, and download the decoded file.
Should I Base64-encode large images?+
Generally no: Base64 adds about 33% to the size and isn't cached separately. It's best for small, frequently-used graphics.
Related tools
Convert Image
PNG ⇄ JPG ⇄ WebP in one click
CSV to JSON
Turn spreadsheets into JSON
Number Base Converter
Binary · Octal · Decimal · Hex
Or browse all 50 free tools.
