convertCASEpro

MODE

Base64 Encode and Decode

Paste text to encode it, or paste Base64 to read what it holds.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the Base64 Encode and Decode works

Base64 represents binary data using 64 printable characters so that it can travel through systems built for text, such as email and JSON. This tool first converts your text to UTF-8 bytes and then encodes those bytes, so emoji and accented characters survive a round trip. Many simple encoders get this wrong and fail on anything beyond ASCII.

The URL-safe option swaps plus and slash for hyphen and underscore and lets you drop the equals padding, which is the form used in JSON Web Tokens and many URLs. When decoding, both alphabets are accepted and missing padding is added automatically.

When it is useful

  • •Reading an encoded value from a config file, API response or email header.
  • •Embedding small text data in a URL, cookie or JSON field.
  • •Debugging authentication headers that use Base64 for credentials.
  • •Checking what is hiding inside a data URL.

Frequently Asked Questions

Is Base64 encryption?

No. Anyone can decode it, so it offers no secrecy. It is only an encoding that makes bytes safe to move as text.

Why is the encoded output about a third larger?

Every three bytes of input become four characters of output, so Base64 adds roughly 33 percent to the size.

Why does decoding fail?

The input may contain characters outside the Base64 alphabet, or the decoded bytes may not form valid UTF-8 text, which happens when the original was a binary file such as an image.

Related tools

[ Browse all tools ]