The base64 command encodes and decodes Base64 data.

# To encode a file:
base64 -i plain_file

# To decode a file:
base64 -D -i base64_file

# To encode from stdin:
echo plain_text | base64

# To decode from stdin:
echo base64_text | base64 -D