Skip to content

base64 encoding/decoding on MacOS

base64 coomand

$ echo -n "Input:String" | base64
SW5wdXQ6U3RyaW5n
$ echo -n "SW5wdXQ6U3RyaW5n" | base64 -D
Input:String

Note: you should use base64 -D on MacOS!

Python

$ echo "Input:String" | python3 -m base64
SW5wdXQ6U3RyaW5nCg==
$ echo "SW5wdXQ6U3RyaW5nCg==" | python3 -m base64 -d
Input:String