Base64 Image Converter
Encode an image to Base64, or decode a Base64 string back into an image — both directions, entirely in your browser.
Convert between image and Base64
Choose a direction below, then upload an image or paste a Base64 string.
Result
Encoding an image
- Switch the direction dropdown to Image → Base64 (the default).
- Drag and drop an image into the box, or click to browse and select one.
- The data URI and Base64 string appear instantly, along with a preview and the encoded length.
- Use Copy Data URI or Copy Base64 only to copy the result you need.
Decoding a Base64 string
- Switch the direction dropdown to Base64 → Image.
- Paste a full data URI, or a raw Base64 string plus the correct image type from the dropdown.
- Press Decode & Preview to render the image.
- Click Download image to save the decoded file.
FAQ
Frequently asked questions
Is my image or Base64 string uploaded anywhere?
No. Encoding and decoding happens locally in your browser using the FileReader API. Nothing is uploaded to a server.
What is a Base64 image string used for?
It lets you embed an image directly inside HTML, CSS or JSON without a separate file request. This is common in emails, icons and data URIs.
What's the difference between the raw Base64 string and a data URI?
A data URI adds a prefix like data:image/png;base64, before the Base64 string so browsers know how to render it directly. This tool shows both and lets you copy either.
Can I decode Base64 that doesn't include the data:image/... prefix?
Yes — if you paste a raw Base64 string without a prefix, select the correct image type from the dropdown so it can be decoded and previewed correctly.
