Super easy on Linux
Encode:
echo -n "sometext" | base64
-n do not output the trailing newline
Decode:
echo "c29tZXRleHQ=" | base64 --decode