How to Base64 Encode/Decode in the Terminal/CLI

If you need to either Encode or Decode a Base64 value, there are many ways to achieve this, one of them is directly from your commandline itself!

How to Encode a Base64 value in CLI

echo 'This is a test' | base64
Code language: Bash (bash)

This will output a base64 encoded value of VGhpcyBpcyBhIHRlc3QK

How to Decode a Base64 value in CLI

echo VGhpcyBpcyBhIHRlc3QK | base64 --decode
Code language: Bash (bash)

This will output a decoded value from our base64 value of This is a test

Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments