Base64 Encode/Decode Tool

What is Base64?

Base64 is an encoding scheme for representing binary data using only ASCII characters. It can represent any data using only 64 printable alphanumeric characters.

It is mainly used to safely transmit binary data in text-based protocols such as email and HTTP. It is also used when using data URLs in HTML and CSS.

Base64 encoded data is about 33% larger than the original data, but it has the advantage of being safely handled in any environment.

For example, if you Base64-encode the string "Hello, World!", it becomes SGVsbG8sIFdvcmxkIQ==.

How to execute with Linux command

In Linux, you can use the base64 command to perform Base64 encoding and decoding.

Encoding example:
echo -n "Hello, World!" | base64
Result: SGVsbG8sIFdvcmxkIQ==

Decoding example:
echo -n "SGVsbG8sIFdvcmxkIQ==" | base64 -d
Result: Hello, World!

To encode a file:
base64 filename > encoded_result.txt

To decode a file:
base64 -d encoded_file > decoded_result.txt