MultiConvers

How to Encode Base64

Convert text to UTF-8 bytes, then to Base64. The result is longer ASCII, not a secret. Unicode and emoji need the UTF-8 step or they will be corrupted.

By Andreas Rosenberg

Steps

  1. Start with the exact text you want represented as bytes.
  2. Encode those characters as UTF-8. Skipping this and using a Latin-1-only function breaks å, ä, ö and emoji.
  3. Apply the Base64 alphabet to those bytes.
  4. Copy the ASCII result. Remember: anyone can decode it.

On the MultiConvers Base64 encoder, paste the text and choose Encode. The UTF-8 step is already done.

Examples

UTF-8 text to Base64
TextBase64
HelloSGVsbG8=
GöteborgR8O2dGVib3Jn

Base64 is still not encryption — see what Base64 is. If you need a value safe inside a query string, you may also need percent-encoding.

FAQ

Why is the Base64 longer than my text?

Every three bytes become four characters. UTF-8 also uses more than one byte for many non-ASCII letters.

Can I encode a file, not text?

This page encodes text as UTF-8. Binary files use the same Base64 alphabet after you read their bytes; that is a different input path.

Related guides

Related tools

See all guides.