Encoding

Encode text to Base64

Base64 writes bytes using a 64-character alphabet (A–Z, a–z, 0–9, + and /) plus = padding, so the result is about a third longer than the input. Developers use it to carry binary-safe strings through JSON, email headers and data URLs. The text is converted to UTF-8 first, so accents, Hindi and emoji encode correctly, and the output matches Python's base64.b64encode and Node's Buffer.from(text).toString('base64') for the same text.

How to use Base64 Encode

  1. Open Base64 Encode in the Toolbox101 app.
  2. Type or paste the text you want encoded into the Input box.
  3. Read the encoded string in the Output box; it updates as you type.
  4. Click Copy and paste the result where you need it.

Worked example

Base64 Encode returns the output below for this input.

Input

hello world

Output

aGVsbG8gd29ybGQ=

Check it yourself: open Base64 Encode and enter the same input.

Frequently asked questions

Is Base64 the same as encryption?

No. Base64 is an encoding, not encryption: the alphabet is public and anyone can reverse it in seconds with no key. Use it to make data safe to move through email, JSON or URLs, never to protect it. If the content has to stay secret, encrypt it with a cipher such as AES first and encode the ciphertext.

Does it handle emoji and non-English text?

Yes. The text is converted to UTF-8 bytes before encoding, so héllo becomes aMOpbGxv. A decoder has to read the bytes back as UTF-8 to recover the text, which the Base64 Decode tool here does.

Why do Base64 outputs end with = signs?

Base64 packs three input bytes into four output characters. When the input length is not a multiple of three, one or two = signs are added so the output stays a multiple of four: one for one leftover byte, two for two. The padding is redundant, since a decoder can work it out, which is why the URL-safe variant drops it.

How is Base64URL different from Base64?

Base64URL is the URL-safe variant: + becomes -, / becomes _, and the trailing = padding is removed. The packing is otherwise identical. Use it whenever the encoded string lands in a URL, query string or JWT, where +, / and = would need percent-escaping. The Base64URL Encode tool produces that form.

Use Base64 Encode now

Runs in your browser. Nothing you type is uploaded.