Developer Encoding

Base64 encoder

What to do

Processed in your browser · nothing is uploaded

Local · an encoding, never encryption
Advertisement
320 × 100

Encodes text as Base64 through UTF-8, so accented characters and emoji work: the naive browser approach throws on both.

How to use the base64 encoder

1 Type or paste the text.
2 Encode gives the standard alphabet with padding; Encode URL-safe swaps + and / for - and _ and drops the =.
3 Decode reads either alphabet back again.
4 Copy the result, or save it as a file.

Base64 turns three bytes into four printable characters, making it about a third larger than what went in. That third is real where it costs you: on disk, in memory, and in the time something takes to parse. Over the wire it largely is not, because the encoded text uses only 64 symbols and gzip compresses almost all of the expansion back out, so a Base64 payload inside a compressed response is not costing you a third of the transfer, whatever the arithmetic suggests. Judge it on parsing and memory, not bandwidth.

The arithmetic itself is worth knowing for sizing a field. Every three bytes become four characters. A single leftover byte becomes two characters plus ==; two leftover bytes become three plus =. So "Hi". Two bytes. Encodes as SGk=, and any padded Base64 string has a length that is a multiple of four.

The URL-safe variant swaps + and / for - and _ and drops the padding, because the standard alphabet does not survive a URL or a filename intact. It is the same encoding underneath; only the alphabet changes.

Two practical notes. Base64 is an encoding, not encryption: anyone can reverse it instantly, so encoding a password or a token protects nothing at all. And the output here is one unbroken line: MIME historically wrapped Base64 at 76 characters, and a few older decoders still expect those breaks, though nothing in a URL, a header or a JSON field wants them.

Questions

No. It is an encoding and anyone can reverse it instantly. It offers no protection whatsoever.

RFC 4648. Base16, Base32 and Base64 data encodings
Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding