Would you like to learn how to encode Base64 using Python? In this tutorial, we are going to show you how to encode and decode using Python on a computer running Linux.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• Python 3.8.5
• Python 2.7.18

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Python - Encoding a text using Base64

Encode a text using Base64.

Copy to Clipboard

Here is the output:

Copy to Clipboard

Decode a text using Base64.

Copy to Clipboard

Here is the output:

Copy to Clipboard

Congratulations! You are able to encrypt a text using Python.

Tutorial Python - Encoding a binary using Base64

Encode a binary using Base64.

Copy to Clipboard

Here is the output:

Copy to Clipboard

Decode a binary using Base64.

Copy to Clipboard

In our example, a new PNG image named MYIMAGE will be created.

Congratulations! You are able to encode binary data using Python.