1. Home
  2. Linux
  3. Base64 decode on linux

How to: Base64 decode on Linux

Do you share messages using the Base64 encoding tool due to privacy? Want to learn how you can decode these messages natively on your Linux system? If so, this guide is for you! Follow along as we go over ways to decode Base64 messages on Linux!

Base64 decode – Basez

One way to decrypt Base64 encodings on Linux is with the Basez, a command-line utility that can decode Base64 encrypted texts. However, the Basez application doesn’t come pre-installed on any Linux system. So, before we go over how to use it to decode text, the program must be installed.

To start the installation of Basez on Linux, open up a terminal window on the desktop. The terminal window can be opened on most desktop environments by pressing the Ctrl + Alt + T keyboard combination. 

Once the terminal window is open on the desktop, follow the command-line installation instructions for Basez down below that correspond with the Linux operating system you currently use.

Ubuntu

On Ubuntu Linux, the BaseZ application is installable with the following Apt command below.

sudo apt install basez

Debian

If you are using Debian Linux, you’ll be able to get BaseZ working using the following Apt-get command.

sudo apt-get install basez

Arch Linux 

Basez isn’t in the official Arch Linux software repositories. However, you’ll still be able to install it from the Arch Linux AUR. To start the installation, get the Trizen AUR helper set up on your system using the commands below.

sudo pacman -S git base-devel

git clone https://aur.archlinux.org/trizen.git

cd trizen

makepkg -sri

With Trizen installed, make use of the trizen -S command to get Basez working.

trizen -S basez

Fedora/OpenSUSE

Sadly, both Fedora and OpenSUSE Linux do not have Basez packages available in their software repositories. If you wish to use Basez, you will need to download and compile the code here manually.

After installing the Basez program on your Linux PC, the decoding can begin. In a terminal window, enter the following command below to decrypt your Base64 string.

Keep in mind that the command below is an example. You must erase the example Base64 code and replace it with your own code.

echo 'SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==' > /tmp/base64-encoding | basez -d /tmp/base64-encoding

In this example encoding, the message is “This is a test.” When the command above is run, you will see the encrypted text decrypt in the terminal window.

For more information on how to use the Basez decrypter/encrypter, make use of the man basez command. By executing this command, you’ll be able to read the manual for the program, learn special operations not covered in the article, and more.

Base64 decode – Base64 command-line app

Another way to decode Base64 encrypted text on Linux is with the built-in Base64 program included on all Linux operating systems. The Base64 app is part of the GNU Core Utilities, and thus we do not need to go over how to install it.

Any Linux user can access the Base64 program included on their operating system. If you’re curious about the app’s functions, you can execute the base64 –help command in a terminal window.

base64 --help

Alternatively, if you’d like to take an in-depth look at how the Base64 app works on Linux, execute the man base64 command to view its manual entry.

man base64

If you have a Base64 encrypted line of text you’d like to decrypt, open up a terminal window and enter your code into the example command below between the ‘ ‘ marks.

echo 'SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==' | base64 --decode

After entering the command below, the Base64 app will print out your decoded text in the terminal, which you can then copy and use however you see fit.

Base64 decode – Base64decode.org

Command-line utilities are great, and Basez, as well as the built-in Base64 app, do a great job of decoding encrypted Base64 text, but that’s not the only way you can decode Base64 encodings. It is also possible to do it on the internet.

If you’d like to decode a Base64 string of code on Linux and you’d like to avoid the command-line, you’ll want to check out Base64decode.org. It’s an excellent website that allows users to decode Base64 with ease quickly.

To start, open up your favorite Linux web browser. Once it is open, head over to Base64decode.org. Then, with the website loaded up, find the text box that says “Type (or paste) here,” and paste in your code.

After pasting your code into the decoding box, click on the green “DECODE” button. When you select the “DECODE” button with the mouse, the website will descramble your Base64 encoding and output the decoded message. You can then copy the message to your clipboard from the website.