Base64 string encoder/decoder

Simply encode and decode strings into their base64 representation.

About Base64 string encoder/decoder

Base64 turns arbitrary bytes into a text made of 64 printable characters so they can travel through channels that only handle text, such as JSON fields, URLs, e-mail or HTTP headers. This tool encodes text to Base64 and decodes it back, handling UTF-8 characters correctly.

When you would use it

How to use it

  1. To encode, type or paste text in "String to encode"; the Base64 version appears below it.
  2. To decode, paste a Base64 string in the second card; the decoded text appears below it.
  3. Switch on the URL-safe option on either side when the value is used in a URL or a JWT.
  4. Use the copy buttons to take the result.

Things worth knowing

Frequently asked questions

Why does decoding say my string is invalid?
Usual causes: a URL-safe string decoded without the URL-safe option (or the other way around), characters that are not part of the alphabet, or a truncated copy.
Why do I see garbled characters after decoding?
The original bytes probably were not UTF-8 text, for example a binary file or text in another encoding. Decoding is only meaningful for text that was encoded from UTF-8.

All the tools