About this tool
Turning a Base64 string from an API response back into readable text, or the other way around — encoding a token or a small file for a JSON or CSS payload — comes up often during development. Paste your input and this tool encodes or decodes it immediately.
Switch direction with the Encode / Decode tabs. If a string can't be decoded, because it isn't valid Base64 or its length is wrong, the tool shows an error right where the result would appear.
Beyond plain text, you can also select an image file to encode. The output can be a data URL you can paste straight into CSS or HTML, and the reverse works too: paste a Base64 or data URL string and preview it as an image, with a download button to save it.
How to use it
- Pick Encode or Decode, then Text or Image, from the tabs at the top.
- For text, paste it into the box. For an image, use the "Select image" button to choose a file.
- The result appears on the right as you type. Decoding an image shows a preview and a download button.
- While encoding, use the URL-safe and "Output as data URL" switches to control the output format.
Features
Works with text and images
Convert a string to Base64, or select an image file to encode it — and preview a Base64 string back as an image.
Data URL output
When encoding an image, output it as a data URL (data:image/png;base64,...) ready to paste into CSS or HTML.
Handles multibyte text
Text input is encoded as UTF-8, so Japanese, emoji or other multibyte characters convert correctly.
Runs entirely in your browser
All conversion happens in JavaScript in your browser, so sensitive data like images or tokens is never sent anywhere.
Frequently asked questions
Does Base64 encrypt the data?
No. Base64 isn't encryption — it's just a way to represent binary data using letters, digits and a couple of symbols. Anyone can decode it, so it shouldn't be used to protect sensitive information.
Why do I get a "couldn't decode" error?
This appears when the input isn't a valid Base64 length or contains characters that aren't part of the Base64 alphabet. Check for stray line breaks or extra spaces in what you pasted.
How much bigger does an image get once it's Base64?
Base64 needs roughly 4/3 (about 33%) more characters than the original binary data. Keep that in mind for large images, since it affects transfer size and render time.
The Base64 I pasted doesn't show up as an image
If the string isn't already a data URL, pick the correct MIME type (like image/png) from the dropdown on the right. If it still doesn't appear, the data itself may not be a valid image.