Advertisement

Base64 Encode / Decode

Encode text to Base64 or decode it back — the classic way to transmit binary data as ASCII.

Advertisement

How to Use This Converter

Pick an operation, paste your input and convert. Use the URL-safe option when embedding data in URLs or file names.

  • Encoding is reversible — the same alphabet decodes any valid input.
  • Only valid Base64 strings can be decoded; malformed input shows an error.

Frequently Asked Questions

Is Base64 encryption?

No. It's an encoding that only transforms data; anyone can decode it instantly. Use real encryption for secrets.

Why does output get ~33% bigger?

Each 3 input bytes become 4 output characters (6 bits per character instead of 8), so the size increases by one third.

What is URL-safe Base64?

The standard alphabet uses + and / which are special in URLs. URL-safe mode swaps them for − and _ and drops padding.

Why am I getting decode errors?

Input may contain invalid characters, wrong padding, or line breaks. Some Base64 variants use different alphabets.

Practical Example

Encode the text Hello and you get SGVsbG8=. Decode SGVsbG8= and you get Hello back — encoding and decoding are exact inverses.

  • Longer input: Hello World encodes to SGVsbG8gV29ybGQ=.
  • URL-safe mode turns +/ into -_ and drops the trailing = padding.

What Your Results Mean

  • Padding — trailing = characters show the final group was short and round it out to a multiple of 4.
  • Output length — roughly 4 characters for every 3 input bytes, so the encoded text is about 33% longer than the original.
  • Decode errors — mean the input contains characters outside the Base64 alphabet, wrong padding, or unexpected line breaks.

Trusted Sources

Advertisement