🔐

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings back to plain text.

Result

What is this?

The Base64 Encoder / Decoder converts text to Base64 and back in one click. Base64 represents binary or text data using only 64 safe ASCII characters (A-Z, a-z, 0-9, + and /), which is why it appears everywhere data must travel through text-only channels: email attachments (MIME), data URIs embedded in HTML and CSS, JSON Web Tokens, and API payloads.

Encoding takes each 3 bytes of input and rewrites them as 4 Base64 characters, so the output is about a third larger than the input - that is the price of text safety. Encoding is not encryption: anyone can decode Base64 instantly, so never use it to hide secrets; its job is safe transport, not confidentiality. The tool handles Unicode correctly by encoding UTF-8 first, so emoji and non-Latin text survive the round trip intact - a step naive encoders get wrong.

Choose the mode to match your direction: paste plain text and encode it, or paste a Base64 string and decode it back. Invalid Base64 input in decode mode - wrong padding or characters outside the alphabet - returns a clear error rather than garbage.

All conversion happens locally in your browser; nothing you paste is uploaded, making the tool safe for tokens and snippets under NDA.

Formula

Base64 maps every 3 bytes (24 bits) onto 4 characters of 6 bits each
Output length = 4 x ceil(input bytes / 3), padded with = to a multiple of 4

Frequently Asked Questions

What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in ASCII string format.