Encode an image file to a Base64 string, or decode Base64 back to an image.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Convert an image to Base64 for free.
Drop an image here, or click to upload
PNG, JPG, or WebP
Your decoded image will appear here.
- Runs entirely in your browser — your image is never uploaded
- Encode an image to Base64, or decode a Base64 string back to an image
- Free, no account required
How it works
-
1
Choose Encode or Decode.
-
2
To encode, drop an image and choose whether to include the data URI prefix.
-
3
To decode, paste a Base64 string or data URI.
-
4
Copy the Base64 text, or download the decoded image.
About the Image to Base64
Base64 turns an image into plain text, so it can be pasted straight into HTML, CSS, JSON or an email template without a separate file. This tool does both directions. Encode reads an image and gives you its Base64 string, with or without the data URI prefix. Decode takes a string or data URI, shows the image, and lets you save it.
What you can do
- Encode any image file to Base64 and copy it with one click.
- Tick or untick "Include data URI prefix" to get a full data:image/...;base64 URI or just the raw string.
- Paste a Base64 string or data URI in Decode mode to preview the image.
- Download the decoded image as decoded-image.png.
When it works best
- Inlining a small icon or logo in CSS or an HTML email to save a network request.
- Putting test images into a JSON fixture or an API request body.
- Checking what image a Base64 blob in a log, database or API response actually contains.
Things to know
- Encoding and decoding happen locally; the image and the text stay in your browser.
- Base64 is about a third larger than the original file, so inlining only pays off for small images.
- A raw string without a prefix is read as PNG. If it holds a JPG or another type, paste the full data URI instead.
- Base64 is an encoding, not encryption, so anyone can decode it. For text and other data, use Base64 Encode/Decode.
Frequently asked questions
Include it for use in HTML or CSS src and url() values. Leave it out when a system expects only the raw string.
A string without a prefix is assumed to be PNG. Paste the full data URI so the type is known.
Yes, by about a third, so inlining only makes sense for small images such as icons.
No, it is an encoding anyone can reverse. Everything here runs in your browser.