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
- Reading a Base64 value taken from a config file, an HTTP header or a JSON payload to see what it holds.
- Producing a Base64 string to put in an environment variable or a Kubernetes secret manifest.
- Creating a URL-safe value for a query string or a JWT-style segment.
How to use it
- To encode, type or paste text in "String to encode"; the Base64 version appears below it.
- To decode, paste a Base64 string in the second card; the decoded text appears below it.
- Switch on the URL-safe option on either side when the value is used in a URL or a JWT.
- Use the copy buttons to take the result.
Things worth knowing
- Base64 is an encoding, not encryption. Anyone can decode it, so it does not protect secrets.
- The URL-safe variant swaps + and / for - and _ and drops the trailing = padding. Decoding with the wrong setting reports an invalid string.
- Encoded data is about one third larger than the original (3 bytes become 4 characters).
- Decoded bytes that are not valid text, such as an image or a compressed file, are not shown meaningfully here. Use the file converter for binary data.
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.