Text to Base64

Encode text as Base64

Encode any text (UTF-8) as standard or URL-safe Base64, optionally wrapped into lines for email.
Try an example:

Output will appear here...

About Text to Base64

How it works

  1. Your text is converted to UTF-8 bytes.
  2. Every 3 bytes (24 bits) become four Base64 characters, each representing 6 bits.
  3. "=" padding completes the last group; URL-safe mode swaps + and / for - and _ and drops the padding.

What you need

  • Any text.

Tips

  • The output is always about 4/3 the size of the input bytes.
  • Wrap at 76 characters for email (MIME); leave unwrapped for APIs, JSON and data: URLs.

Limitations

  • Base64 is not encryption - anyone can decode it.

Runs in your browser. Everything happens in your browser - the text you enter is never uploaded.

Frequently asked questions

How is this used for HTTP Basic authentication?+

The header is "Authorization: Basic " followed by Base64 of "username:password". That is easy to decode, so Basic auth must only be used over HTTPS.