Input

Mode:

Output

What Is Text to Base64 Encoding?

Base64 is a way to represent binary data — or any text — using only 64 printable ASCII characters. It's not encryption; it's encoding. You'll bump into it constantly when working with HTTP Authorization headers, JWTs, email attachments via MIME, and anywhere a binary-safe transport is needed but only ASCII text is allowed. This tool handles the encoding in your browser — paste text in, get Base64 out. No server involved.

Switch between Encode (text → Base64) and Decode (Base64 → text) using the mode buttons. The encoder uses a UTF-8-safe method so characters like emojis, Chinese, Arabic, or any non-Latin text encode correctly — unlike the browser's raw btoa() which only handles Latin-1.

How to Use This Tool

1

Choose Mode

Select Encode to convert plain text to a Base64 string, or Decode to convert a Base64 string back to plain text.

2

Paste Input

Paste your text or Base64 string into the left editor. Use Sample to load an example, or Upload to read from a file.

3

Copy or Download Result

The right panel updates automatically as you type. Use Copy to grab the output or Download to save it as a file.

Example

Encoding the classic greeting "Hello, World!" to Base64:

Text Input

Input

Base64 Output

Output

Frequently Asked Questions

Is Base64 encoding the same as encryption?

No. Base64 is encoding, not encryption. Anyone who sees a Base64 string can decode it instantly — there's no secret key involved. It's designed for safe text transport, not confidentiality. If you need to protect data, use proper encryption like AES via the Web Crypto API.

Why does Base64 output end with = or ==?

Base64 encodes 3 bytes at a time into 4 characters. If the input length isn't a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. One = means one byte of padding was added; two means two bytes. See RFC 4648 §4 for the full spec.

Can I encode Unicode, emoji, or non-Latin text?

Yes. This tool uses a UTF-8-safe encoding path: the input is first encoded with encodeURIComponent(), then unescaped, then passed to btoa(). This correctly handles Chinese, Arabic, Japanese, emoji, and any other Unicode text. The browser's native btoa() alone would throw an error on non-Latin-1 characters — MDN explains the workaround.

Is my text private when I use this tool?

Completely. All encoding and decoding runs in your browser using JavaScript. Nothing is sent to a server. You can verify this by opening your browser's Network tab while using the tool — you'll see zero requests fired.

What is the difference between standard Base64 and Base64url?

Standard Base64 (defined in RFC 4648) uses + and / as the 62nd and 63rd characters, plus = padding. Base64url (used in JWTs and URLs) replaces those with - and _, and omits padding. If you need Base64url output, use our Base64 URL Encoder instead.

Why does Base64 output look longer than the input?

By design — every 3 bytes of input become 4 characters of Base64, so the output is roughly 33% larger than the input. This is the overhead you pay for a binary-safe, ASCII-only representation.

Related Tools

The Base64 encoding scheme is defined in RFC 4648. See also MDN: Base64 and the btoa() API reference.